public function postItemAction(Request $request)
 {
     $em = $this->container->get('doctrine')->getManager();
     $item = new Item();
     $user = $em->getRepository('UAWRestBundle:User')->find(intval($this->getUser()->getId()));
     $item->setType($request->request->get('type'));
     $item->setName($request->request->get('name'));
     $item->setUser($user);
     $em->persist($item);
     $em->flush();
     return $item;
 }
Exemple #2
0
 /**
  * @return Integer
  * @VirtualProperty
  */
 public function getItemId()
 {
     return $this->item->getId();
 }