public function validateTopic() { if ($this->topic === null) { $this->validationErrors()->add('topic_id', 'required'); return; } if (!$this->topic->isFeatureTopic()) { $this->validationErrors()->add('topic_id', '.not_feature_topic'); } }