1000 ], [ ['bachelor_application_id'], 'exist', 'skipOnError' => true, 'targetClass' => BachelorApplication::class, 'targetAttribute' => ['bachelor_application_id' => 'id'] ], [ ['author_id'], 'exist', 'skipOnError' => true, 'targetClass' => User::class, 'targetAttribute' => ['author_id' => 'id'] ], ]; } public function attributeLabels() { return [ 'answer' => Yii::t('abiturient/bachelor/comment/comments-coming', 'Подпись для поля "answer"; формы комментария: `Ответ на комментарий`'), 'comment' => Yii::t('abiturient/bachelor/comment/comments-coming', 'Подпись для поля "comment"; формы комментария: `Комментарий`'), 'author_id' => Yii::t('abiturient/bachelor/comment/comments-coming', 'Подпись для поля "author_id"; формы комментария: `id автора комментария`'), 'bachelor_application_id' => Yii::t('abiturient/bachelor/comment/comments-coming', 'Подпись для поля "bachelor_application_id"; формы комментария: `id заявления`'), ]; } public function getApplication() { return $this->hasOne(BachelorApplication::class, ['id' => 'bachelor_application_id']); } public function getAuthor() { return $this->hasOne(User::class, ['id' => 'author_id']); } public function getChangeLoggedAttributes() { return ['comment']; } public function getClassTypeForChangeHistory(): int { return ChangeHistoryClasses::CLASS_ABITURIENT_COMMENT; } public function afterValidate() { (new LoggingAfterValidateHandler()) ->setModel($this) ->invoke(); } }