|
@@ -0,0 +1,100 @@
|
|
|
+<?php
|
|
|
+
|
|
|
+namespace app\models;
|
|
|
+
|
|
|
+use Yii;
|
|
|
+
|
|
|
+/**
|
|
|
+ * This is the model class for table "Servicio".
|
|
|
+ *
|
|
|
+ * @property string $id
|
|
|
+ * @property string $factura
|
|
|
+ * @property string $tipo
|
|
|
+ * @property string|null $descripcion
|
|
|
+ * @property string|null $fechaServicio
|
|
|
+ * @property string|null $idTaller
|
|
|
+ * @property string|null $idVehiculo
|
|
|
+ * @property string|null $creado
|
|
|
+ * @property string|null $modificado
|
|
|
+ * @property string|null $eliminado
|
|
|
+ *
|
|
|
+ * @property Taller $idTaller
|
|
|
+ * @property Vehiculo $idVehiculo
|
|
|
+ * @property ServicioElemento[] $servicioElementos
|
|
|
+ */
|
|
|
+class Servicio extends ModeloBase
|
|
|
+{
|
|
|
+ /**
|
|
|
+ * {@inheritdoc}
|
|
|
+ */
|
|
|
+ public static function tableName()
|
|
|
+ {
|
|
|
+ return 'Servicio';
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * {@inheritdoc}
|
|
|
+ */
|
|
|
+ public function rules()
|
|
|
+ {
|
|
|
+ return [
|
|
|
+ [['id', 'factura', 'tipo'], 'required'],
|
|
|
+ [['descripcion'], 'string'],
|
|
|
+ [['fechaServicio', 'creado', 'modificado', 'eliminado'], 'safe'],
|
|
|
+ [['id', 'idTaller', 'idVehiculo'], 'string', 'max' => 36],
|
|
|
+ [['factura', 'tipo'], 'string', 'max' => 100],
|
|
|
+ [['id'], 'unique'],
|
|
|
+ [['idTaller'], 'exist', 'skipOnError' => true, 'targetClass' => Taller::class, 'targetAttribute' => ['idTaller' => 'id']],
|
|
|
+ [['idVehiculo'], 'exist', 'skipOnError' => true, 'targetClass' => Vehiculo::class, 'targetAttribute' => ['idVehiculo' => 'id']],
|
|
|
+ ];
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * {@inheritdoc}
|
|
|
+ */
|
|
|
+ public function attributeLabels()
|
|
|
+ {
|
|
|
+ return [
|
|
|
+ 'id' => 'ID',
|
|
|
+ 'factura' => 'Factura',
|
|
|
+ 'tipo' => 'Tipo',
|
|
|
+ 'descripcion' => 'Descripcion',
|
|
|
+ 'fechaServicio' => 'Fecha Servicio',
|
|
|
+ 'idTaller' => 'Id Taller',
|
|
|
+ 'idVehiculo' => 'Id Vehiculo',
|
|
|
+ 'creado' => 'Creado',
|
|
|
+ 'modificado' => 'Modificado',
|
|
|
+ 'eliminado' => 'Eliminado',
|
|
|
+ ];
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Gets query for [[IdTaller0]].
|
|
|
+ *
|
|
|
+ * @return \yii\db\ActiveQuery
|
|
|
+ */
|
|
|
+ public function getTaller()
|
|
|
+ {
|
|
|
+ return $this->hasOne(Taller::class, ['id' => 'idTaller']);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Gets query for [[IdVehiculo0]].
|
|
|
+ *
|
|
|
+ * @return \yii\db\ActiveQuery
|
|
|
+ */
|
|
|
+ public function getVehiculo()
|
|
|
+ {
|
|
|
+ return $this->hasOne(Vehiculo::class, ['id' => 'idVehiculo']);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Gets query for [[ServicioElementos]].
|
|
|
+ *
|
|
|
+ * @return \yii\db\ActiveQuery
|
|
|
+ */
|
|
|
+ public function getServicioElemento()
|
|
|
+ {
|
|
|
+ return $this->hasMany(ServicioElemento::class, ['idServicio' => 'id']);
|
|
|
+ }
|
|
|
+}
|