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