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)); }
public function executeMarkers(sfWebRequest $request) { $this->places = placesTable::getInstance()->findAll(); $this->setLayout(false); $this->getResponse()->setContentType('text/xml'); }