Ejemplo n.º 1
0
 public function delete()
 {
     if (isset($_GET['id']) && isset($_GET['confirm'])) {
         $addressCollection = new AddressCollection();
         $addressCollection->remove(array('id' => $_GET['id']));
         header('Location: index.php?c=address');
         exit;
     }
     $this->loadView('address/delete');
 }
 /**
  * @param string
  * @return Collection
  */
 public function dump($dumper)
 {
     $dumperClasses = collect(['geojson' => GeoJson::class, 'gpx' => Gpx::class, 'kml' => Kml::class, 'wkb' => Wkb::class, 'wkt' => Wkt::class]);
     if (!$dumperClasses->has($dumper)) {
         $errorMessage = implode('', ["The dumper specified ('{$dumper}') is invalid. Valid dumpers ", "are: geojson, gpx, kml, wkb, wkt."]);
         throw new InvalidDumperException($errorMessage);
     }
     $dumperClass = $dumperClasses->get($dumper);
     $dumper = new $dumperClass();
     $results = collect($this->results->all());
     return $results->map(function ($result) use($dumper) {
         return $dumper->dump($result);
     });
 }