Files
contao-leaflet-maps/src/Event/BuildDefinitionEvent.php

94 lines
1.9 KiB
PHP
Raw Normal View History

2014-12-29 12:17:40 +01:00
<?php
/**
2017-10-05 15:45:43 +02:00
* Leaflet maps for Contao CMS.
*
2016-10-11 10:40:15 +02:00
* @package contao-leaflet-maps
2014-12-29 12:17:40 +01:00
* @author David Molineus <david.molineus@netzmacht.de>
2017-10-11 15:00:48 +02:00
* @copyright 2014-2017 netzmacht David Molineus. All rights reserved.
2017-10-05 15:45:43 +02:00
* @license LGPL-3.0 https://github.com/netzmacht/contao-leaflet-maps/blob/master/LICENSE
2014-12-29 12:17:40 +01:00
* @filesource
*/
namespace Netzmacht\Contao\Leaflet\Event;
2017-10-17 18:03:42 +02:00
use Contao\Model;
use Netzmacht\Contao\Leaflet\Mapper\Request;
2014-12-29 12:17:40 +01:00
use Netzmacht\LeafletPHP\Definition;
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
{
2017-10-06 15:50:34 +02:00
const NAME = 'netzmacht.contao_leaflet.mapper.build_definition';
2014-12-29 12:17:40 +01:00
/**
* The leaflet object definition.
*
* @var Definition
*/
private $definition;
/**
* The model.
*
* @var Model
2014-12-29 12:17:40 +01:00
*/
private $model;
2015-01-06 14:55:53 +01:00
/**
* Building request.
2015-01-06 14:55:53 +01:00
*
* @var Request|null
2015-01-06 14:55:53 +01:00
*/
private $request;
2015-01-06 14:55:53 +01:00
2014-12-29 12:17:40 +01:00
/**
* Construct.
*
2015-01-06 14:55:53 +01:00
* @param Definition $definition The leaflet definition.
2017-10-17 18:03:42 +02:00
* @param Model $model The definition model.
* @param Request|null $request Building request.
2014-12-29 12:17:40 +01:00
*/
2017-10-17 18:03:42 +02:00
public function __construct(Definition $definition, Model $model, Request $request = null)
2014-12-29 12:17:40 +01:00
{
$this->definition = $definition;
2015-01-06 14:55:53 +01:00
$this->model = $model;
$this->request = $request;
2014-12-29 12:17:40 +01:00
}
/**
* Get the definition.
*
* @return Definition
*/
public function getDefinition()
{
return $this->definition;
}
/**
* Get the model.
*
* @return Model
2014-12-29 12:17:40 +01:00
*/
public function getModel()
{
return $this->model;
}
2015-01-06 14:55:53 +01:00
/**
* Get the bounds.
*
* @return Request|null
2015-01-06 14:55:53 +01:00
*/
public function getRequest()
2015-01-06 14:55:53 +01:00
{
return $this->request;
2015-01-06 14:55:53 +01:00
}
2014-12-29 12:17:40 +01:00
}