protected function beforeSave() { if (!parent::beforeSave()) { return false; } if (!$this->checkCreatorIsAdherent()) { throw new PetitionRateException('Petition can be rated by mandate\'s adherents only'); } return true; }