function() { return $this->hh; }, 'owner_id', 'owner_info' => function(){ return [ "fio" => $this->owner->userCard->fio ?? ($this->user->id ?? ''), "avatar" => $this->owner->userCard->photo ?? '', ]; }, 'company' => function() { return $this->company; }, 'projectUsers', ]; } /** * @return string[] */ public function extraFields(): array { return ['columns', 'mark']; } /** * @return ActiveQuery */ public function getProjectUsers() { return $this->hasMany(ProjectUser::class, ['project_id' => 'id']); } public function getLinks(): array { return [ Link::REL_SELF => Url::to(['index', 'project_id' => $this->id], true), ]; } public function getCompany(): ActiveQuery { return $this->hasOne(Company::className(), ['id' => 'company_id']); } }