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