1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- <?php
- namespace app\models;
- use Yii;
- /**
- * This is the model class for table "ObraEmpleado".
- *
- * @property string $id
- * @property string|null $idObra
- * @property string|null $idEmpleado
- * @property string|null $creado
- * @property string|null $modificado
- * @property string|null $eliminado
- *
- * @property Empleado $idEmpleado0
- * @property Obra $idObra0
- */
- class ObraEmpleado extends ModeloBase
- {
- /**
- * {@inheritdoc}
- */
- public static function tableName()
- {
- return 'ObraEmpleado';
- }
- /**
- * {@inheritdoc}
- */
- public function rules()
- {
- return [
- [['id'], 'required'],
- [['creado', 'modificado', 'eliminado'], 'safe'],
- [['id', 'idObra', 'idEmpleado'], 'string', 'max' => 36],
- [['id'], 'unique'],
- [['idEmpleado'], 'exist', 'skipOnError' => true, 'targetClass' => Empleado::class, 'targetAttribute' => ['idEmpleado' => 'id']],
- [['idObra'], 'exist', 'skipOnError' => true, 'targetClass' => Obra::class, 'targetAttribute' => ['idObra' => 'id']],
- ];
- }
- /**
- * {@inheritdoc}
- */
- public function attributeLabels()
- {
- return [
- 'id' => 'ID',
- 'idObra' => 'Id Obra',
- 'idEmpleado' => 'Id Empleado',
- 'creado' => 'Creado',
- 'modificado' => 'Modificado',
- 'eliminado' => 'Eliminado',
- ];
- }
- /**
- * Gets query for [[IdEmpleado0]].
- *
- * @return \yii\db\ActiveQuery
- */
- public function getEmpleado()
- {
- return $this->hasOne(Empleado::class, ['id' => 'idEmpleado']);
- }
- /**
- * Gets query for [[IdObra0]].
- *
- * @return \yii\db\ActiveQuery
- */
- public function getObra()
- {
- return $this->hasOne(Obra::class, ['id' => 'idObra']);
- }
- }
|