You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
simple-yewu/common/models/MiddlePartStoreRoom.php

72 lines
1.7 KiB

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