1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- <?php
- namespace app\models;
- use Yii;
- /**
- * This is the model class for table "Herramienta".
- *
- * @property string $id
- * @property string $nombre
- * @property string|null $idTipoHerramienta
- * @property number|null $costo
- * @property string $serie
- * @property string|null $fechaCompra
- * @property string $estatus
- * @property string|null $descripcion
- * @property string|null $creado
- * @property string|null $modificado
- * @property string|null $eliminado
- *
- * @property TipoHerramienta $idTipoHerramienta
- */
- class Herramienta extends ModeloBase
- {
- /**
- * {@inheritdoc}
- */
- public static function tableName()
- {
- return 'Herramienta';
- }
- /**
- * {@inheritdoc}
- */
- public function rules()
- {
- return [
- [['id','nombre','serie','estatus'], 'required'],
- [['fechaCompra','creado', 'modificado', 'eliminado'], 'safe'],
- [['id', 'idTipoHerramienta'], 'string', 'max' => 36],
- [['costo'], 'number'],
- [['nombre','descripcion','estatus','serie'], 'string', 'max' => 100],
- [['id'], 'unique'],
- [['idTipoHerramienta'], 'exist', 'skipOnError' => true, 'targetClass' => TipoHerramienta::class, 'targetAttribute' => ['idTipoHerramienta' => 'id']],
- ];
- }
- /**
- * {@inheritdoc}
- */
- public function attributeLabels()
- {
- return [
- 'id' => 'ID',
- 'nombre' => 'Nombre',
- 'idTipoHerramienta' => 'Id Tipo Herramienta',
- 'costo' => 'Costo',
- 'serie' => 'Serie',
- 'fechaCompra' => 'Fecha Compra',
- 'estatus' => 'Estatus',
- 'descripcion' => 'Descripcion',
- 'creado' => 'Creado',
- 'modificado' => 'Modificado',
- 'eliminado' => 'Eliminado',
- ];
- }
- /**
- * Gets query for [[IdServicio]].
- *
- * @return \yii\db\ActiveQuery
- */
- public function getTipoHerramienta()
- {
- return $this->hasOne(TipoHerramienta::class, ['id' => 'idTipoHerramienta']);
- }
- }
|