public function deleteAction()
 {
     $neighborhood_id = $this->params()->fromRoute('id');
     $neighborhood_name = $this->paramFromRoute('neighborhood');
     $region_name = $this->paramFromRoute('region');
     $this->logger()->info("deleting neighborhood with id " . $neighborhood_id);
     if ($neighborhood_id) {
         $neighborhood = $this->m()->neighborhoodMapper()->byId($neighborhood_id);
         \Whathood\Util::prompt_user(sprintf("are you sure you want to delete neighborhood?\n\tid=%s\n\tname=%s\n\tregion=%s\n", $neighborhood->getId(), $neighborhood->getName(), $neighborhood->getRegion()->getName()));
         $this->m()->neighborhoodMapper()->delete($neighborhood, $this->m()->userPolygonMapper(), $this->m()->neighborhoodPolygonMapper(), $this->m()->heatMapPoint());
         $this->logger()->info("neighborhood deleted");
     } else {
         throw new \Exception('not yet implemented');
     }
 }
Esempio n. 2
0
 public static function prompt_user($msg)
 {
     \Whathood\Util::prompt_user("{$msg}; Enter to continue; CTRL-C to cancel");
 }