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