|
@@ -16,53 +16,50 @@ use Yii;
|
|
|
*
|
|
|
* @property Estado $idEstado
|
|
|
*/
|
|
|
-class Municipio extends ModeloBase
|
|
|
-{
|
|
|
- /**
|
|
|
- * {@inheritdoc}
|
|
|
- */
|
|
|
- public static function tableName()
|
|
|
- {
|
|
|
- return 'Municipio';
|
|
|
- }
|
|
|
+class Municipio extends ModeloBase {
|
|
|
+ /**
|
|
|
+ * {@inheritdoc}
|
|
|
+ */
|
|
|
+ public static function tableName() {
|
|
|
+ return 'Municipio';
|
|
|
+ }
|
|
|
|
|
|
- /**
|
|
|
- * {@inheritdoc}
|
|
|
- */
|
|
|
- public function rules()
|
|
|
- {
|
|
|
- return [
|
|
|
- [['id'], 'required'],
|
|
|
- [['creado', 'modificado', 'eliminado'], 'safe'],
|
|
|
- [['id', 'idEstado'], 'string', 'max' => 36],
|
|
|
- [['nombre'], 'string', 'max' => 100],
|
|
|
- [['id'], 'unique'],
|
|
|
- [['idEstado'], 'exist', 'skipOnError' => true, 'targetClass' => Estado::class, 'targetAttribute' => ['idEstado' => 'id']],
|
|
|
- ];
|
|
|
- }
|
|
|
+ /**
|
|
|
+ * {@inheritdoc}
|
|
|
+ */
|
|
|
+ public function rules() {
|
|
|
+ return [
|
|
|
+ [['id'], 'required'],
|
|
|
+ [['clave'], 'integer'],
|
|
|
+ [['creado', 'modificado', 'eliminado'], 'safe'],
|
|
|
+ [['id', 'idEstado'], 'string', 'max' => 36],
|
|
|
+ [['nombre'], 'string', 'max' => 100],
|
|
|
+ [['id'], 'unique'],
|
|
|
+ [['idEstado'], 'exist', 'skipOnError' => true, 'targetClass' => Estado::class, 'targetAttribute' => ['idEstado' => 'id']],
|
|
|
+ ];
|
|
|
+ }
|
|
|
|
|
|
- /**
|
|
|
- * {@inheritdoc}
|
|
|
- */
|
|
|
- public function attributeLabels()
|
|
|
- {
|
|
|
- return [
|
|
|
- 'id' => 'ID',
|
|
|
- 'nombre' => 'Nombre',
|
|
|
- 'idEstado' => 'Id Estado',
|
|
|
- 'creado' => 'Creado',
|
|
|
- 'modificado' => 'Modificado',
|
|
|
- 'eliminado' => 'Eliminado',
|
|
|
- ];
|
|
|
- }
|
|
|
+ /**
|
|
|
+ * {@inheritdoc}
|
|
|
+ */
|
|
|
+ public function attributeLabels() {
|
|
|
+ return [
|
|
|
+ 'id' => 'ID',
|
|
|
+ 'nombre' => 'Nombre',
|
|
|
+ 'idEstado' => 'Id Estado',
|
|
|
+ 'creado' => 'Creado',
|
|
|
+ 'modificado' => 'Modificado',
|
|
|
+ 'eliminado' => 'Eliminado',
|
|
|
+ 'clave' => 'Clave'
|
|
|
+ ];
|
|
|
+ }
|
|
|
|
|
|
- /**
|
|
|
- * Gets query for [[IdEstado]].
|
|
|
- *
|
|
|
- * @return \yii\db\ActiveQuery
|
|
|
- */
|
|
|
- public function getIdEstado()
|
|
|
- {
|
|
|
- return $this->hasOne(Estado::class, ['id' => 'idEstado']);
|
|
|
- }
|
|
|
+ /**
|
|
|
+ * Gets query for [[IdEstado]].
|
|
|
+ *
|
|
|
+ * @return \yii\db\ActiveQuery
|
|
|
+ */
|
|
|
+ public function getIdEstado() {
|
|
|
+ return $this->hasOne(Estado::class, ['id' => 'idEstado']);
|
|
|
+ }
|
|
|
}
|