1: <?php
2: /**
3: * PHP version 5
4: * @package generalDriver
5: * @author Christian Schiffler <c.schiffler@cyberspectrum.de>
6: * @author Stefan Heimes <stefan_heimes@hotmail.com>
7: * @author Tristan Lins <tristan.lins@bit3.de>
8: * @copyright The MetaModels team.
9: * @license LGPL.
10: * @filesource
11: */
12:
13: namespace DcGeneral\Event;
14:
15: use DcGeneral\EnvironmentAwareInterface;
16: use DcGeneral\EnvironmentInterface;
17: use Symfony\Component\EventDispatcher\Event;
18:
19: /**
20: * Abstract base class for environment aware events
21: *
22: * @package DcGeneral\Event
23: */
24: abstract class AbstractEnvironmentAwareEvent
25: extends Event
26: implements EnvironmentAwareInterface
27: {
28: /**
29: * The environment attached to this event.
30: *
31: * @var EnvironmentInterface
32: */
33: protected $environment;
34:
35: /**
36: * Create a new environment aware event.
37: *
38: * @param EnvironmentInterface $environment The environment to attach.
39: */
40: public function __construct(EnvironmentInterface $environment)
41: {
42: $this->environment = $environment;
43: }
44:
45: /**
46: * {@inheritdoc}
47: */
48: public function getEnvironment()
49: {
50: return $this->environment;
51: }
52: }
53: