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\EnvironmentInterface;
17:
18: /**
19: * This event is emitted after a model has been duplicated.
20: *
21: * @package DcGeneral\Event
22: */
23: class PostDuplicateModelEvent extends AbstractModelAwareEvent
24: {
25: const NAME = 'dc-general.model.post-duplicate';
26:
27: /**
28: * The source model.
29: *
30: * @var ModelInterface
31: */
32: protected $sourceModel;
33:
34: /**
35: * Create a new instance.
36: *
37: * @param EnvironmentInterface $environment The environment.
38: *
39: * @param ModelInterface $model The new model.
40: *
41: * @param ModelInterface $sourceModel The source model.
42: */
43: public function __construct(EnvironmentInterface $environment, ModelInterface $model, ModelInterface $sourceModel)
44: {
45: parent::__construct($environment, $model);
46: $this->sourceModel = $sourceModel;
47: }
48:
49: /**
50: * Retrieve the source model.
51: *
52: * @return \DcGeneral\Data\ModelInterface
53: */
54: public function getSourceModel()
55: {
56: return $this->sourceModel;
57: }
58: }
59: