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\DataDefinition\Definition\View\CommandInterface;
16: use DcGeneral\EnvironmentInterface;
17:
18: /**
19: * This class is the base foundation for a command event.
20: *
21: * @package DcGeneral\Event
22: */
23: abstract class AbstractCommandEvent extends AbstractEnvironmentAwareEvent implements CommandEventInterface
24: {
25: /**
26: * The command attached to the event.
27: *
28: * @var CommandInterface
29: */
30: protected $command;
31:
32: /**
33: * Create a new instance.
34: *
35: * @param CommandInterface $command The command to attach.
36: *
37: * @param EnvironmentInterface $environment The environment in use.
38: */
39: public function __construct(CommandInterface $command, EnvironmentInterface $environment)
40: {
41: parent::__construct($environment);
42: $this->command = $command;
43: }
44:
45: /**
46: * Return the command.
47: *
48: * @return CommandInterface
49: */
50: public function getCommand()
51: {
52: return $this->command;
53: }
54: }
55: