Esempio n. 1
0
 /**
  * Get map with locations
  *
  * @param  int $id
  * @return string
  */
 public function getMap($id)
 {
     $map = Table\Maps::findById($id);
     if (isset($map->id)) {
         $mapData = $map->getColumns();
         $mapData['map_id'] = 'phire-map-' . $id;
         $mapData['map_class'] = 'phire-map-div';
         $mapData['locations'] = Table\MapLocations::findBy(['map_id' => $id])->rows();
         $view = new View(__DIR__ . '/../../view/maps-public/map.phtml', $mapData);
         return $view->render();
     } else {
         return '';
     }
 }
Esempio n. 2
0
 /**
  * Get count of maps
  *
  * @return int
  */
 public function getCount()
 {
     return Table\MapLocations::findAll()->count();
 }