123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101 |
- <?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']);
- }
- }
|