1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- <?php
- namespace app\models;
- use Yii;
- use yii\base\Model;
- /**
- * This is the model class for table "Estado".
- *
- * @property string $id
- * @property string|null $nombre
- * @property string|null $abreviacion
- * @property string|null $creado
- * @property string|null $modificado
- * @property string|null $eliminado
- *
- * @property Municipio[] $municipios
- */
- class Estado extends ModeloBase {
- /**
- * {@inheritdoc}
- */
- public static function tableName() {
- return 'Estado';
- }
- /**
- * {@inheritdoc}
- */
- public function rules() {
- return [
- [['id'], 'required'],
- /* [['clave'], 'integer'], */
- [['creado', 'modificado', 'eliminado'], 'safe'],
- [['id', 'pais'], 'string', 'max' => 36],
- [['nombre'], 'string', 'max' => 100],
- [['abreviacion'], 'string', 'max' => 16],
- [['id'], 'unique'],
- ];
- }
- /**
- * {@inheritdoc}
- */
- public function attributeLabels() {
- return [
- 'id' => 'ID',
- 'nombre' => 'Nombre',
- 'abreviacion' => 'Abreviacion',
- 'creado' => 'Creado',
- 'modificado' => 'Modificado',
- 'eliminado' => 'Eliminado',
- /* 'clave' => 'Clave', */
- /* 'pais' => 'Pais', */
- ];
- }
- /**
- * Gets query for [[Municipios]].
- *
- * @return \yii\db\ActiveQuery
- */
- public function getMunicipios() {
- return $this->hasMany(Municipio::class, ['idEstado' => 'id']);
- }
- }
|