<?php namespace common\models; use Yii; /** * This is the model class for table "fix_car_mateials". * * @property integer $id * @property integer $store_room_id * @property string $created_at * @property string $updated_at * * @property StoreRoom $storeRoom */ class FixCarMateials extends \common\models\Base { /** * @inheritdoc */ public static function tableName() { return 'fix_car_mateials'; } /** * @inheritdoc */ public function rules() { return [ [['store_room_id'], 'integer'], [['created_at', 'updated_at'], 'safe'], [['store_room_id'], 'exist', 'skipOnError' => true, 'targetClass' => StoreRoom::className(), 'targetAttribute' => ['store_room_id' => 'id']], ]; } /** * @inheritdoc */ public function attributeLabels() { return [ 'id' => 'ID', 'store_room_id' => 'Store Room ID', 'created_at' => 'Created At', 'updated_at' => 'Updated At', ]; } /** * @return \yii\db\ActiveQuery */ public function getStoreRoom() { return $this->hasOne(StoreRoom::className(), ['id' => 'store_room_id']); } }