Esempio n. 1
0
 public function getTempEventForNumber($temp_number, $demoNumber)
 {
     $event = $this->findOneBy(['HostNumber' => $temp_number, "isDemo" => true]);
     if ($event) {
         return $event;
     }
     $temp_event = new Event();
     $temp_event->setEventName('Temporary Texty Event');
     $temp_event->setQuote('Have fun with friends');
     $temp_event->setEventLength(2);
     $temp_event->setStartTime(new \DateTime());
     $temp_event->setHostNumber($temp_number);
     $temp_event->setAllAdmin(false);
     $temp_event->setIsDemo(true);
     $temp_event->setTwilioNumber($demoNumber);
     $this->getEntityManager()->persist($temp_event);
     $this->getEntityManager()->flush();
     return $temp_event;
 }
Esempio n. 2
0
 /**
  * @Route("/", name="endpoint_input")
  * @Method("GET")
  * @Template()
  */
 public function indexAction(Request $request)
 {
     $endpoint = $request->query->get('endpoint');
     if ($endpoint !== 'input') {
         return array('success' => false, 'message' => 'Error: Invalid Endpoint Request!');
     }
     $eventName = $request->query->get('eventName');
     $eventValue = $request->query->get('eventValue');
     if (!empty($eventName) && !empty($eventValue)) {
         $em = $this->getDoctrine()->getManager();
         $entity = new Event();
         $entity->setEventName($eventName);
         $entity->setEventValue($eventValue);
         $entity->setReferrerUrl($this->getRequest()->getUri());
         $em->persist($entity);
         $em->flush();
         return array('success' => true, 'message' => 'Success: Added a new Input Endpoint Request!');
     } else {
         return array('success' => false, 'message' => 'Error: Invalid Endpoint Request!');
     }
     return array('success' => false, 'message' => 'Error: Invalid Endpoint Request!');
 }