123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- <?php
- namespace app\models;
- use Yii;
- /**
- * This is the model class for table "Obra".
- *
- * @property string $id
- * @property string $nombre
- * @property string|null $fechaInicio
- * @property string|null $fechaFinal
- * @property string|null $descripcion
- * @property string|null $creado
- * @property string|null $modificado
- * @property string|null $eliminado
- * @property string|null $clave
- *
- * @property HerramientaObra[] $herramientaObras
- * @property ObraEmpleado[] $obraEmpleados
- * @property ObraHerramienta[] $obraHerramientas
- */
- class Obra extends ModeloBase
- {
- /**
- * {@inheritdoc}
- */
- public static function tableName()
- {
- return 'Obra';
- }
- /**
- * {@inheritdoc}
- */
- public function rules()
- {
- return [
- [['id', 'nombre', 'fechaInicio','fechaFinal'], 'required'],
- [['fechaInicio','fechaFinal','creado', 'modificado', 'eliminado'], 'safe'],
- [['id'], 'string', 'max' => 36],
- [['nombre', 'descripcion','clave'], 'string', 'max' => 100],
- [['id'], 'unique'],
- ];
- }
- /**
- * {@inheritdoc}
- */
- public function attributeLabels()
- {
- return [
- 'id' => 'ID',
- 'clave' => 'Clave',
- 'nombre' => 'Nombre',
- 'fechaInicio' => 'Fecha Inicio',
- 'fechaFinal' => 'Fecha Final',
- 'descripcion' => 'Descripcion',
- 'creado' => 'Creado',
- 'modificado' => 'Modificado',
- 'eliminado' => 'Eliminado',
- ];
- }
- public function getHerramientaObras()
- {
- return $this->hasMany(HerramientaObra::class, ['idObra' => 'id']);
- }
- public function getObraEmpleado()
- {
- return $this->hasMany(ObraEmpleado::class, ['idObra' => 'id']);
- }
- public function getObraHerramienta()
- {
- return $this->hasMany(ObraHerramienta::class, ['idObra' => 'id']);
- }
- }
|