Beispiel #1
0
 public function addMessage(\Projet\UserBundle\Entity\Message $message)
 {
     $this->messages[] = $message;
     $message->setUser($this);
 }
 /**
  * Displays a form to create a new Message entity already set for a User.
  *
  */
 public function newToAction($username)
 {
     $entity = new Message();
     $entity->setDestinataire($username);
     $form = $this->createForm(new MessageType(), $entity);
     return $this->render('ProjetUserBundle:Message:new.html.twig', array('entity' => $entity, 'form' => $form->createView()));
 }