true, 'targetClass' => AdditionalFields::class, 'targetAttribute' => ['field_id' => 'id']], ]; } /** * {@inheritdoc} */ public function attributeLabels() { return [ 'id' => 'ID', 'field_id' => 'Поле', 'use' => 'Применение', ]; } /** * @return \yii\db\ActiveQuery */ public function getField() { return $this->hasOne(AdditionalFields::className(), ['id' => 'field_id']); } public function getStatuses() { return [ self::USE_PROFILE => 'Профиль', self::USE_PROJECT => 'Проект', self::USE_COMPANY => 'Компания' ]; } /** * @return string status text label */ public function getStatusesText() { return $this->statuses[$this->status_id]; } }