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.
62 lines
1.4 KiB
62 lines
1.4 KiB
5 years ago
|
<?php
|
||
|
|
||
|
namespace common\models;
|
||
|
|
||
|
use Yii;
|
||
|
use yii\db\ActiveRecord;
|
||
|
|
||
|
/**
|
||
|
* This is the model class for table "fix_car_slave_project".
|
||
|
*
|
||
|
* @property integer $project_id
|
||
|
* @property integer $price
|
||
|
* @property integer $level
|
||
|
* @property integer $type
|
||
|
*
|
||
|
* @property FixCarProject $project
|
||
|
*/
|
||
|
class FixCarSlaveProject extends ActiveRecord
|
||
|
{
|
||
|
/**
|
||
|
* @inheritdoc
|
||
|
*/
|
||
|
public static function tableName()
|
||
|
{
|
||
|
return 'fix_car_slave_project';
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* @inheritdoc
|
||
|
*/
|
||
|
public function rules()
|
||
|
{
|
||
|
return [
|
||
|
[['project_id'], 'required'],
|
||
|
[['project_id', 'price', 'level', 'type'], 'integer'],
|
||
|
[['project_id', 'level'], 'unique', 'targetAttribute' => ['project_id', 'level'], 'message' => 'The combination of Project ID and Level has already been taken.'],
|
||
|
[['project_id'], 'exist', 'skipOnError' => true, 'targetClass' => FixCarProject::className(), 'targetAttribute' => ['project_id' => 'id']],
|
||
|
];
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* @inheritdoc
|
||
|
*/
|
||
|
public function attributeLabels()
|
||
|
{
|
||
|
return [
|
||
|
'project_id' => 'Project ID',
|
||
|
'price' => 'Price',
|
||
|
'level' => 'Level',
|
||
|
'type' => 'Type',
|
||
|
];
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* @return \yii\db\ActiveQuery
|
||
|
*/
|
||
|
public function getProject()
|
||
|
{
|
||
|
return $this->hasOne(FixCarProject::className(), ['id' => 'project_id']);
|
||
|
}
|
||
|
}
|