| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 |
- <?php
- namespace app\models;
- use Yii;
- /**
- * This is the model class for table "Agencia".
- *
- * @property int $idAgencia
- * @property int|null $id
- * @property string|null $nombre
- * @property string|null $direccion
- * @property string|null $contacto
- * @property string|null $descripcion
- * @property int|null $clave
- * @property int|null $idUsuarioCreador
- * @property string|null $creado
- * @property string|null $modificado
- * @property string|null $eliminado
- *
- * @property Usuario $id0
- * @property Usuario[] $usuarios
- */
- class Agencia extends \yii\db\ActiveRecord
- {
- /**
- * {@inheritdoc}
- */
- public static function tableName()
- {
- return 'Agencia';
- }
- /**
- * {@inheritdoc}
- */
- public function rules()
- {
- return [
- [['id', 'clave', 'idUsuarioCreador'], 'default', 'value' => null],
- [['id', 'clave', 'idUsuarioCreador'], 'integer'],
- [['creado', 'modificado', 'eliminado'], 'safe'],
- [['nombre'], 'string', 'max' => 50],
- [['direccion'], 'string', 'max' => 20],
- [['contacto', 'descripcion'], 'string', 'max' => 255],
- [['id'], 'exist', 'skipOnError' => true, 'targetClass' => Usuario::class, 'targetAttribute' => ['id' => 'id']],
- ];
- }
- /**
- * {@inheritdoc}
- */
- public function attributeLabels()
- {
- return [
- 'idAgencia' => 'Id Agencia',
- 'id' => 'ID',
- 'nombre' => 'Nombre',
- 'direccion' => 'Direccion',
- 'contacto' => 'Contacto',
- 'descripcion' => 'Descripcion',
- 'clave' => 'Clave',
- 'idUsuarioCreador' => 'Id Usuario Creador',
- 'creado' => 'Creado',
- 'modificado' => 'Modificado',
- 'eliminado' => 'Eliminado',
- ];
- }
- /**
- * Gets query for [[Id0]].
- *
- * @return \yii\db\ActiveQuery
- */
- public function getIdUsuario()
- {
- return $this->hasOne(Usuario::class, ['id' => 'id']);
- }
- /**
- * Gets query for [[Usuarios]].
- *
- * @return \yii\db\ActiveQuery
- */
- public function getUsuario()
- {
- return $this->hasMany(Usuario::class, ['idAgencia' => 'idAgencia']);
- }
- }
|