1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- <?php
- namespace app\models;
- use Yii;
- /**
- * This is the model class for table "ServicioElemento".
- *
- * @property string $id
- * @property string|null $idServicio
- * @property string|null $elemento
- * @property string|null $costo
- * @property string|null $descripcion
- * @property string|null $creado
- * @property string|null $modificado
- * @property string|null $eliminado
- *
- * @property Servicio $idServicio
- */
- class ServicioElemento extends ModeloBase
- {
- /**
- * {@inheritdoc}
- */
- public static function tableName()
- {
- return 'ServicioElemento';
- }
- /**
- * {@inheritdoc}
- */
- public function rules()
- {
- return [
- [['id'], 'required'],
- [['creado', 'modificado', 'eliminado'], 'safe'],
- [['id', 'idServicio'], 'string', 'max' => 36],
- [['elemento'], 'string', 'max' => 255],
- [['costo', 'descripcion'], 'string', 'max' => 100],
- [['id'], 'unique'],
- [['idServicio'], 'exist', 'skipOnError' => true, 'targetClass' => Servicio::class, 'targetAttribute' => ['idServicio' => 'id']],
- ];
- }
- /**
- * {@inheritdoc}
- */
- public function attributeLabels()
- {
- return [
- 'id' => 'ID',
- 'idServicio' => 'Id Servicio',
- 'elemento' => 'Elemento',
- 'costo' => 'Costo',
- 'descripcion' => 'Descripcion',
- 'creado' => 'Creado',
- 'modificado' => 'Modificado',
- 'eliminado' => 'Eliminado',
- ];
- }
- /**
- * Gets query for [[IdServicio]].
- *
- * @return \yii\db\ActiveQuery
- */
- public function getServicio()
- {
- return $this->hasOne(Servicio::class, ['id' => 'idServicio']);
- }
- }
|