/** * @return bool */ public function addParticipant() { if ($this->validate()) { $participant = new Participant(); $participant->setAttributes($this->getAttributes()); if ($participant->save()) { return $participant->id; } } return $this->getErrors(); }