1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- <?php
- namespace app\models;
- use Yii;
- /**
- * This is the model class for table "Nivel".
- *
- * @property string $id
- * @property string|null $nombre
- * @property string|null $idMunicipio
- * @property string|null $clave
- * @property string|null $creado
- * @property string|null $modificado
- * @property string|null $eliminado
- *
- * @property Municipio $idMunicipio0
- */
- class Nivel extends ModeloBase
- {
- /**
- * {@inheritdoc}
- */
- public static function tableName()
- {
- return 'Nivel';
- }
- /**
- * {@inheritdoc}
- */
- public function rules()
- {
- return [
- [['id'], 'required'],
- [['creado', 'modificado', 'eliminado'], 'safe'],
- [['id', 'idMunicipio'], 'string', 'max' => 36],
- [['nombre', 'clave'], 'string', 'max' => 100],
- [['id'], 'unique'],
- [['idMunicipio'], 'exist', 'skipOnError' => true, 'targetClass' => Municipio::class, 'targetAttribute' => ['idMunicipio' => 'id']],
- ];
- }
- /**
- * {@inheritdoc}
- */
- public function attributeLabels()
- {
- return [
- 'id' => 'ID',
- 'nombre' => 'Nombre',
- 'idMunicipio' => 'Id Municipio',
- 'clave' => 'Clave',
- 'creado' => 'Creado',
- 'modificado' => 'Modificado',
- 'eliminado' => 'Eliminado',
- ];
- }
- /**
- * Gets query for [[IdMunicipio0]].
- *
- * @return \yii\db\ActiveQuery
- */
- public function getIdMunicipio()
- {
- return $this->hasOne(Municipio::class, ['id' => 'idMunicipio']);
- }
- }
|