Make definition mapper independent of the data format.

This commit is contained in:
David Molineus
2015-01-12 09:55:59 +01:00
parent ce715bbb0a
commit 9a37da12e6
4 changed files with 178 additions and 6 deletions

View File

@@ -0,0 +1,82 @@
<?php
/**
* @package dev
* @author David Molineus <david.molineus@netzmacht.de>
* @copyright 2015 netzmacht creative 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;
}
}