forked from Snck3rs/contao-leaflet-maps
Switch to PSR-4.
This commit is contained in:
91
src/Event/BuildDefinitionEvent.php
Normal file
91
src/Event/BuildDefinitionEvent.php
Normal file
@@ -0,0 +1,91 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package contao-leaflet-maps
|
||||
* @author David Molineus <david.molineus@netzmacht.de>
|
||||
* @copyright 2014-2016 netzmacht David Molineus
|
||||
* @license LGPL 3.0
|
||||
* @filesource
|
||||
*
|
||||
*/
|
||||
|
||||
namespace Netzmacht\Contao\Leaflet\Event;
|
||||
|
||||
use Netzmacht\LeafletPHP\Definition;
|
||||
use Netzmacht\LeafletPHP\Value\LatLngBounds;
|
||||
use Symfony\Component\EventDispatcher\Event;
|
||||
|
||||
/**
|
||||
* Class BuildDefinitionEvent is emitted when the mapper maps between the model and the definition.
|
||||
*
|
||||
* @package Netzmacht\Contao\Leaflet\Event
|
||||
*/
|
||||
class BuildDefinitionEvent extends Event
|
||||
{
|
||||
const NAME = 'leaflet.mapper.definition';
|
||||
|
||||
/**
|
||||
* The leaflet object definition.
|
||||
*
|
||||
* @var Definition
|
||||
*/
|
||||
private $definition;
|
||||
|
||||
/**
|
||||
* The model.
|
||||
*
|
||||
* @var \Model
|
||||
*/
|
||||
private $model;
|
||||
|
||||
/**
|
||||
* Optional bounds where elements should be in.
|
||||
*
|
||||
* @var LatLngBounds
|
||||
*/
|
||||
private $bounds;
|
||||
|
||||
/**
|
||||
* Construct.
|
||||
*
|
||||
* @param Definition $definition The leaflet definition.
|
||||
* @param \Model $model The definition model.
|
||||
* @param LatLngBounds $bounds Optional bounds where elements should be in.
|
||||
*/
|
||||
public function __construct(Definition $definition, \Model $model, LatLngBounds $bounds = null)
|
||||
{
|
||||
$this->definition = $definition;
|
||||
$this->model = $model;
|
||||
$this->bounds = $bounds;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the definition.
|
||||
*
|
||||
* @return Definition
|
||||
*/
|
||||
public function getDefinition()
|
||||
{
|
||||
return $this->definition;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the model.
|
||||
*
|
||||
* @return \Model
|
||||
*/
|
||||
public function getModel()
|
||||
{
|
||||
return $this->model;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the bounds.
|
||||
*
|
||||
* @return LatLngBounds|null
|
||||
*/
|
||||
public function getBounds()
|
||||
{
|
||||
return $this->bounds;
|
||||
}
|
||||
}
|
||||
91
src/Event/ConvertToGeoJsonEvent.php
Normal file
91
src/Event/ConvertToGeoJsonEvent.php
Normal file
@@ -0,0 +1,91 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package contao-leaflet-maps
|
||||
* @author David Molineus <david.molineus@netzmacht.de>
|
||||
* @copyright 2014-2016 netzmacht David Molineus
|
||||
* @license LGPL 3.0
|
||||
* @filesource
|
||||
*
|
||||
*/
|
||||
|
||||
namespace Netzmacht\Contao\Leaflet\Event;
|
||||
|
||||
use Netzmacht\LeafletPHP\Definition;
|
||||
use Netzmacht\LeafletPHP\Value\GeoJson\GeoJsonObject;
|
||||
use Symfony\Component\EventDispatcher\Event;
|
||||
|
||||
/**
|
||||
* Class ConvertToGeoJsonEvent is emitted when the DefinitionMapper converts a definition to a geo json feature.
|
||||
*
|
||||
* @package Netzmacht\Contao\Leaflet\Event
|
||||
*/
|
||||
class ConvertToGeoJsonEvent extends Event
|
||||
{
|
||||
const NAME = 'leaflet.mapper.convert-to-geojson';
|
||||
|
||||
/**
|
||||
* The definition.
|
||||
*
|
||||
* @var Definition
|
||||
*/
|
||||
private $definition;
|
||||
|
||||
/**
|
||||
* The GeoJSON object.
|
||||
*
|
||||
* @var GeoJsonObject
|
||||
*/
|
||||
private $geoJson;
|
||||
|
||||
/**
|
||||
* The definition model.
|
||||
*
|
||||
* @var mixed
|
||||
*/
|
||||
private $model;
|
||||
|
||||
/**
|
||||
* Construct.
|
||||
*
|
||||
* @param Definition $definition The definition.
|
||||
* @param GeoJsonObject $geoJson The GeoJSON object.
|
||||
* @param mixed $model The corresponding model. Usually a \Model but could be everything.
|
||||
*/
|
||||
public function __construct(Definition $definition, GeoJsonObject $geoJson, $model)
|
||||
{
|
||||
$this->definition = $definition;
|
||||
$this->geoJson = $geoJson;
|
||||
$this->model = $model;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the definition.
|
||||
*
|
||||
* @return Definition
|
||||
*/
|
||||
public function getDefinition()
|
||||
{
|
||||
return $this->definition;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the geoJson representation.
|
||||
*
|
||||
* @return GeoJsonObject
|
||||
*/
|
||||
public function getGeoJson()
|
||||
{
|
||||
return $this->geoJson;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the model.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function getModel()
|
||||
{
|
||||
return $this->model;
|
||||
}
|
||||
}
|
||||
82
src/Event/GetHashEvent.php
Normal file
82
src/Event/GetHashEvent.php
Normal file
@@ -0,0 +1,82 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package contao-leaflet-maps
|
||||
* @author David Molineus <david.molineus@netzmacht.de>
|
||||
* @copyright 2014-2016 netzmacht David Molineus
|
||||
* @license LGPL 3.0
|
||||
* @filesource
|
||||
*
|
||||
*/
|
||||
|
||||
namespace Netzmacht\Contao\Leaflet\Event;
|
||||
|
||||
use Symfony\Component\EventDispatcher\Event;
|
||||
|
||||
/**
|
||||
* Class GetHashEvent is emitted then a hash for a data object with an unknown type is required.
|
||||
*
|
||||
* @package Netzmacht\Contao\Leaflet\Event
|
||||
*/
|
||||
class GetHashEvent extends Event
|
||||
{
|
||||
const NAME = 'leaflet.get-hash';
|
||||
|
||||
/**
|
||||
* The data.
|
||||
*
|
||||
* @var mixed
|
||||
*/
|
||||
private $data;
|
||||
|
||||
/**
|
||||
* The hash.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $hash;
|
||||
|
||||
/**
|
||||
* Construct.
|
||||
*
|
||||
* @param mixed $data The data.
|
||||
*/
|
||||
public function __construct($data)
|
||||
{
|
||||
$this->data = $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the data.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function getData()
|
||||
{
|
||||
return $this->data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the hash.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getHash()
|
||||
{
|
||||
return $this->hash;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the generated hash.
|
||||
*
|
||||
* @param string $hash The generated hash.
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setHash($hash)
|
||||
{
|
||||
$this->hash = (string) $hash;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
71
src/Event/GetJavascriptEvent.php
Normal file
71
src/Event/GetJavascriptEvent.php
Normal file
@@ -0,0 +1,71 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package contao-leaflet-maps
|
||||
* @author David Molineus <david.molineus@netzmacht.de>
|
||||
* @copyright 2014-2016 netzmacht David Molineus
|
||||
* @license LGPL 3.0
|
||||
* @filesource
|
||||
*
|
||||
*/
|
||||
|
||||
namespace Netzmacht\Contao\Leaflet\Event;
|
||||
|
||||
use Netzmacht\LeafletPHP\Definition\Map;
|
||||
use Symfony\Component\EventDispatcher\Event;
|
||||
|
||||
/**
|
||||
* Class GetJavascriptEvent is emitted after the map javascript was created.
|
||||
*
|
||||
* @package Netzmacht\Contao\Leaflet\Event
|
||||
*/
|
||||
class GetJavascriptEvent extends Event
|
||||
{
|
||||
const NAME = 'leaflet.service.get-javascript';
|
||||
|
||||
/**
|
||||
* The generated javascript.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $javascript;
|
||||
|
||||
/**
|
||||
* The map definition.
|
||||
*
|
||||
* @var Map
|
||||
*/
|
||||
private $map;
|
||||
|
||||
/**
|
||||
* Construct.
|
||||
*
|
||||
* @param Map $map The map definition.
|
||||
* @param string $javascript The generated javascript.
|
||||
*/
|
||||
public function __construct($map, $javascript)
|
||||
{
|
||||
$this->map = $map;
|
||||
$this->javascript = $javascript;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the generated javascript.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getJavascript()
|
||||
{
|
||||
return $this->javascript;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the map definition.
|
||||
*
|
||||
* @return Map
|
||||
*/
|
||||
public function getMap()
|
||||
{
|
||||
return $this->map;
|
||||
}
|
||||
}
|
||||
52
src/Event/InitializeDefinitionMapperEvent.php
Normal file
52
src/Event/InitializeDefinitionMapperEvent.php
Normal file
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package contao-leaflet-maps
|
||||
* @author David Molineus <david.molineus@netzmacht.de>
|
||||
* @copyright 2014-2016 netzmacht David Molineus
|
||||
* @license LGPL 3.0
|
||||
* @filesource
|
||||
*
|
||||
*/
|
||||
|
||||
namespace Netzmacht\Contao\Leaflet\Event;
|
||||
|
||||
use Netzmacht\Contao\Leaflet\Mapper\DefinitionMapper;
|
||||
use Symfony\Component\EventDispatcher\Event;
|
||||
|
||||
/**
|
||||
* Class InitializeDefinitionMapperEvent is emitted when the definition mapper is created.
|
||||
*
|
||||
* @package Netzmacht\Contao\Leaflet\Event
|
||||
*/
|
||||
class InitializeDefinitionMapperEvent extends Event
|
||||
{
|
||||
const NAME = 'leaflet.boot.initialize-definition-mapper';
|
||||
|
||||
/**
|
||||
* The definitino mapper.
|
||||
*
|
||||
* @var DefinitionMapper
|
||||
*/
|
||||
private $definitionMapper;
|
||||
|
||||
/**
|
||||
* Construct.
|
||||
*
|
||||
* @param DefinitionMapper $definitionMapper The definition mapper.
|
||||
*/
|
||||
public function __construct(DefinitionMapper $definitionMapper)
|
||||
{
|
||||
$this->definitionMapper = $definitionMapper;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the definition mapper.
|
||||
*
|
||||
* @return DefinitionMapper
|
||||
*/
|
||||
public function getDefinitionMapper()
|
||||
{
|
||||
return $this->definitionMapper;
|
||||
}
|
||||
}
|
||||
52
src/Event/InitializeEventDispatcherEvent.php
Normal file
52
src/Event/InitializeEventDispatcherEvent.php
Normal file
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package contao-leaflet-maps
|
||||
* @author David Molineus <david.molineus@netzmacht.de>
|
||||
* @copyright 2014-2016 netzmacht David Molineus
|
||||
* @license LGPL 3.0
|
||||
* @filesource
|
||||
*
|
||||
*/
|
||||
|
||||
namespace Netzmacht\Contao\Leaflet\Event;
|
||||
|
||||
use Symfony\Component\EventDispatcher\Event;
|
||||
use Symfony\Component\EventDispatcher\EventDispatcherInterface as EventDispatcher;
|
||||
|
||||
/**
|
||||
* InitializeEventDispatcherEvent is emitted then the internal event dispatcher of the encoding system is initialized.
|
||||
*
|
||||
* @package Netzmacht\Contao\Leaflet\Event
|
||||
*/
|
||||
class InitializeEventDispatcherEvent extends Event
|
||||
{
|
||||
const NAME = 'leaflet.boot.initialize-event-dispatcher';
|
||||
|
||||
/**
|
||||
* The event dispatcher.
|
||||
*
|
||||
* @var EventDispatcher
|
||||
*/
|
||||
private $eventDispatcher;
|
||||
|
||||
/**
|
||||
* The event dispatcher.
|
||||
*
|
||||
* @param EventDispatcher $eventDispatcher The event dispatcher.
|
||||
*/
|
||||
public function __construct(EventDispatcher $eventDispatcher)
|
||||
{
|
||||
$this->eventDispatcher = $eventDispatcher;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the event dispatcher.
|
||||
*
|
||||
* @return EventDispatcher
|
||||
*/
|
||||
public function getEventDispatcher()
|
||||
{
|
||||
return $this->eventDispatcher;
|
||||
}
|
||||
}
|
||||
52
src/Event/InitializeLeafletBuilderEvent.php
Normal file
52
src/Event/InitializeLeafletBuilderEvent.php
Normal file
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package contao-leaflet-maps
|
||||
* @author David Molineus <david.molineus@netzmacht.de>
|
||||
* @copyright 2014-2016 netzmacht David Molineus
|
||||
* @license LGPL 3.0
|
||||
* @filesource
|
||||
*
|
||||
*/
|
||||
|
||||
namespace Netzmacht\Contao\Leaflet\Event;
|
||||
|
||||
use Netzmacht\LeafletPHP\Leaflet;
|
||||
use Symfony\Component\EventDispatcher\Event;
|
||||
|
||||
/**
|
||||
* Class InitializeLeafletBuilderEvent is emitted when the leaflet builder is created.
|
||||
*
|
||||
* @package Netzmacht\Contao\Leaflet\Event
|
||||
*/
|
||||
class InitializeLeafletBuilderEvent extends Event
|
||||
{
|
||||
const NAME = 'leaflet.boot.initialize-leaflet-builder';
|
||||
|
||||
/**
|
||||
* The leaflet builder.
|
||||
*
|
||||
* @var Leaflet
|
||||
*/
|
||||
private $builder;
|
||||
|
||||
/**
|
||||
* Construct.
|
||||
*
|
||||
* @param Leaflet $builder The leaflet builder.
|
||||
*/
|
||||
public function __construct(Leaflet $builder)
|
||||
{
|
||||
$this->builder = $builder;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the builder.
|
||||
*
|
||||
* @return Leaflet
|
||||
*/
|
||||
public function getBuilder()
|
||||
{
|
||||
return $this->builder;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user