1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798 |
- <?php
- namespace app\models;
- use Yii;
- /**
- * This is the model class for table "Servicio".
- *
- * @property string $id
- * @property string $factura
- * @property string $idTipo
- * @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 $idTaller0
- * @property Vehiculo $idVehiculo0
- * @property TipoServicio $idTipo0
- * @property ServicioElemento[] $servicioElementos
- * @property ServicioTipoServicio[] $servicioTipoServicios
- */
- class Servicio extends ModeloBase
- {
- /**
- * {@inheritdoc}
- */
- public static function tableName()
- {
- return 'Servicio';
- }
- /**
- * {@inheritdoc}
- */
- public function rules()
- {
- return [
- [['id', 'factura'], 'required'],
- [['descripcion'], 'string'],
- [['fechaServicio', 'creado', 'modificado', 'eliminado'], 'safe'],
- [['id', 'idTaller', 'idVehiculo', ], 'string', 'max' => 36],
- [['factura'], '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',
- 'descripcion' => 'Descripcion',
- 'fechaServicio' => 'Fecha Servicio',
- 'idTaller' => 'Id Taller',
- 'idVehiculo' => 'Id Vehiculo',
- 'idTipo' => 'Id Tipo',
- 'creado' => 'Creado',
- 'modificado' => 'Modificado',
- 'eliminado' => 'Eliminado',
- ];
- }
- /**
- * Gets query for [[IdTaller0]].
- *
- * @return \yii\db\ActiveQuery
- */
- public function getTaller()
- {
- return $this->hasOne(Taller::class, ['id' => 'idTaller']);
- }
- public function getVehiculo()
- {
- return $this->hasOne(Vehiculo::class, ['id' => 'idVehiculo']);
- }
- public function getServicioElemento()
- {
- return $this->hasMany(ServicioElemento::class, ['idServicio' => 'id']);
- }
- public function getTipoServicio()
- {
- return $this->hasMany(ServicioTipoServicio::class, ['idServicio' => 'id']);
- }
- }
|