コード例 #1
0
 public function storeAction(Request $request)
 {
     $this->assertUserRights(UserRole::ROLE_ADMIN);
     $em = $this->getDoctrine()->getManager();
     if ($request->get('configurationId') > 0) {
         $configuration = $this->getDoctrine()->getRepository('KoalamonNotificationBundle:NotificationConfiguration')->find($request->get('configurationId'));
     } else {
         $configuration = new NotificationConfiguration();
         $configuration->setNotifyAll(false);
     }
     $configuration->setOptions($request->get('options'));
     $configuration->setSenderType($request->get('senderIdentifier'));
     $configuration->setProject($this->getProject());
     $configuration->setName($request->get('name'));
     $em->persist($configuration);
     $em->flush();
     return $this->redirectToRoute('koalamon_notification_home');
 }