|
@@ -0,0 +1,81 @@
|
|
|
+<?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'], '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',
|
|
|
+ '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']);
|
|
|
+ }
|
|
|
+}
|