/** * Sauvegarde l'entité Comment * @param \Blog\Model\Entity\Comment $commentEntity * @return \Blog\Model\Entity\Comment */ public function createCommentEntity(Comment $commentEntity) { $commentEntity->setCreated(new \DateTime()); $commentEntity->setUpdated(new \DateTime()); $this->_em->persist($commentEntity); $this->_em->flush(); return $commentEntity; }