public function editroomAction(Request $request)
 {
     $em = $this->getDoctrine()->getManager();
     $room_id = $request->get('roomid');
     $hostal_id = $request->get('hostal');
     if ($room_id == -1) {
         $hostal = $this->getDoctrine()->getRepository('MytripAdminBundle:Hostal')->find($hostal_id);
         if (!$hostal) {
             // ERROR!
         }
         $room = new HostalRooms();
         $room->setHostal($hostal);
     } else {
         $room = $this->getDoctrine()->getRepository('MytripAdminBundle:HostalRooms')->find($room_id);
         if (!$room) {
             // ERROR!
         }
         // Deleting.
         if ($request->request->get('delete')) {
             $em->remove($room);
             $em->flush();
             return $this->redirect($this->generateUrl('mytrip_admin_edithostal', array('id' => $hostal_id)));
         }
     }
     $room->setRoomtype($request->request->get('roomtype'));
     $room->setGuests($request->request->get('guests'));
     $room->setAdults($request->request->get('adults'));
     $room->setChild($request->request->get('child'));
     $room->setPrice($request->request->get('price'));
     $em->persist($room);
     $em->flush();
     return $this->redirect($this->generateUrl('mytrip_admin_edithostal', array('id' => $hostal_id)));
     //return $this->render(
     //    'MytripAdminBundle:Default:editroom.html.php',
     //    array('room_id' => $room_id)
     //    );
 }
 /**
  * {@inheritDoc}
  */
 public function setHostal(\Mytrip\AdminBundle\Entity\Hostal $hostal = NULL)
 {
     $this->__initializer__ && $this->__initializer__->__invoke($this, 'setHostal', array($hostal));
     return parent::setHostal($hostal);
 }