Пример #1
0
 public function executeGet_description_warning_place_by_id(sfWebRequest $request)
 {
     $id = $request->getParameter('id');
     $place = placesTable::getInstance()->find($id);
     $event = sensor_eventTable::getInstance()->createQuery('e')->select()->where('e.place_id = ' . $place['id'])->limit(1)->orderBy('created_at desc')->execute();
     $resp['id'] = $place['id'];
     $resp['description'] = strlen($event[0]['description']) == 0 ? '' : $event[0]['description'];
     $resp['emergency'] = strlen($event[0]['description']) == 0 ? false : true;
     return $this->renderText(json_encode($resp));
 }
Пример #2
0
 public function executeMarkers(sfWebRequest $request)
 {
     $this->places = placesTable::getInstance()->findAll();
     $this->setLayout(false);
     $this->getResponse()->setContentType('text/xml');
 }