project column
This commit is contained in:
@@ -19,6 +19,7 @@ use yii\helpers\ArrayHelper;
|
||||
* @property string $budget
|
||||
* @property int $company_id
|
||||
* @property int $hh_id
|
||||
* @property int $owner_id
|
||||
*
|
||||
* @property FieldsValue[] $fieldsValues
|
||||
* @property Company $company
|
||||
@@ -59,6 +60,7 @@ class Project extends \yii\db\ActiveRecord
|
||||
[['status'], 'exist', 'skipOnError' => true, 'targetClass' => Status::class, 'targetAttribute' => ['status' => 'id']],
|
||||
[['name'], 'string', 'max' => 255],
|
||||
[['budget'], 'string', 'max' => 100],
|
||||
[['owner_id'], 'integer'],
|
||||
[['company_id'], 'exist', 'skipOnError' => true, 'targetClass' => Company::class, 'targetAttribute' => ['company_id' => 'id']],
|
||||
[['hh_id'], 'exist', 'skipOnError' => true, 'targetClass' => Hh::class, 'targetAttribute' => ['hh_id' => 'id']],
|
||||
];
|
||||
@@ -79,6 +81,7 @@ class Project extends \yii\db\ActiveRecord
|
||||
'budget' => 'Бюджет',
|
||||
'company_id' => 'Компания',
|
||||
'hh_id' => 'Проект на hh.ru',
|
||||
'owner_id' => 'Владелец проекта',
|
||||
];
|
||||
}
|
||||
|
||||
@@ -98,6 +101,14 @@ class Project extends \yii\db\ActiveRecord
|
||||
return $this->hasOne(Company::class, ['id' => 'company_id']);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \yii\db\ActiveQuery
|
||||
*/
|
||||
public function getOwner()
|
||||
{
|
||||
return $this->hasOne(User::class, ['id' => 'owner_id']);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \yii\db\ActiveQuery
|
||||
*/
|
||||
|
Reference in New Issue
Block a user