Add marks to project and task request responses
This commit is contained in:
@ -24,6 +24,8 @@ use yii\helpers\ArrayHelper;
|
||||
* @property FieldsValue[] $fieldsValues
|
||||
* @property Company $company
|
||||
* @property ProjectUser[] $projectUsers
|
||||
* @property Mark[] $mark
|
||||
* @property MarkEntity[] $markEntity
|
||||
*/
|
||||
class Project extends \yii\db\ActiveRecord
|
||||
{
|
||||
@ -135,6 +137,24 @@ class Project extends \yii\db\ActiveRecord
|
||||
return $this->hasMany(ProjectUser::class, ['project_id' => 'id']);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \yii\db\ActiveQuery
|
||||
*/
|
||||
public function getMark()
|
||||
{
|
||||
return $this->hasMany(Mark::class, ['id' => 'mark_id'])
|
||||
->via('markEntity');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \yii\db\ActiveQuery
|
||||
*/
|
||||
public function getMarkEntity()
|
||||
{
|
||||
return $this->hasMany(MarkEntity::class, ['entity_id' => 'id'])
|
||||
->where(['entity_type' => Entity::ENTITY_TYPE_PROJECT]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
|
Reference in New Issue
Block a user