element = $element; } /** * Ajouter un rapport * * @param \Muzich\CoreBundle\Entity\User $user * @param String $comment * @param String $date */ public function add(User $user) { $ids = $this->element->getReportIds(); if ($ids === null){$ids = array();} if (!in_array($user->getId(), $ids)) { $ids[] = (string)$user->getId(); } $this->element->setCountReport(count($ids)); $this->element->setReportIds($ids); } }