1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- <?php
- namespace app\models;
- use Yii;
- /**
- * This is the model class for table "ObraRubro".
- *
- * @property string $id
- * @property string|null $idObra
- * @property string|null $idConceptoObra
- * @property float|null $cantidad
- * @property string|null $descripcion
- * @property string|null $fechaCompra
- * @property string|null $creado
- * @property string|null $modificado
- * @property string|null $eliminado
- *
- * @property ConceptoObra $conceptoObra
- * @property Obra $obra
- */
- class ObraRubro extends ModeloBase {
- /**
- * {@inheritdoc}
- */
- public static function tableName() {
- return 'ObraRubro';
- }
- /**
- * {@inheritdoc}
- */
- public function rules() {
- return [
- [['id'], 'required'],
- [['cantidad', 'descuento'], 'number'],
- [['fechaCompra', 'creado', 'modificado', 'eliminado'], 'safe'],
- [['id', 'idObra', 'idConceptoObra'], 'string', 'max' => 36],
- [['descripcion'], 'string', 'max' => 550],
- [['id'], 'unique'],
- [['idConceptoObra'], 'exist', 'skipOnError' => true, 'targetClass' => ConceptosObra::class, 'targetAttribute' => ['idConceptoObra' => 'id']],
- [['idObra'], 'exist', 'skipOnError' => true, 'targetClass' => Obra::class, 'targetAttribute' => ['idObra' => 'id']],
- ];
- }
- /**
- * {@inheritdoc}
- */
- public function attributeLabels() {
- return [
- 'id' => 'ID',
- 'idObra' => 'Id Obra',
- 'idConceptoObra' => 'Id Concepto Obra',
- 'cantidad' => 'Cantidad',
- 'descripcion' => 'Descripcion',
- 'descuento' => 'Descuento',
- 'fechaCompra' => 'Fecha Compra',
- 'creado' => 'Creado',
- 'modificado' => 'Modificado',
- 'eliminado' => 'Eliminado',
- ];
- }
- /**
- * Gets query for [[IdConceptoObra0]].
- *
- * @return \yii\db\ActiveQuery
- */
- public function getConceptoObra() {
- return $this->hasOne(ConceptosObra::class, ['id' => 'idConceptoObra']);
- }
- /**
- * Gets query for [[IdObra0]].
- *
- * @return \yii\db\ActiveQuery
- */
- public function getObra() {
- return $this->hasOne(Obra::class, ['id' => 'idObra']);
- }
- }
|