/** * @param $name * @param $permaLink * @param Etude $entity * Used only in Mgate\CommentBundle\Controller\DefaultController for undocumented purpose (maintenance ??) */ public function creerThread($name, $permaLink, Etude $entity) { if (!$entity->getThread()) { $thread = $this->tm->createThread($name . $entity->getId()); $thread->setPermalink($permaLink); //non exploité dans notre cas. Commentable. $entity->setThread($thread); //persist thread inutile, car cascade sur $entity. $this->em->flush(); } }