Overview

Namespaces

  • DcGeneral
    • Clipboard
    • Contao
      • Callback
      • Compatibility
      • DataDefinition
        • Definition
      • Dca
        • Builder
          • Legacy
        • Definition
        • Palette
        • Populator
      • Event
      • View
        • Contao2BackendView
          • Event
    • Controller
    • Data
    • DataDefinition
      • Builder
      • Definition
        • Properties
        • View
          • Panel
      • ModelRelationship
      • Palette
        • Builder
          • Event
        • Condition
          • Palette
          • Property
    • EnvironmentPopulator
    • Event
    • Exception
    • Factory
      • Event
    • Panel
    • View
      • Event

Classes

  • AbstractCommandEvent
  • AbstractContainerAwareEvent
  • AbstractEnvironmentAwareEvent
  • AbstractModelAwareEvent
  • AbstractModelCommandEvent
  • AbstractViewAwareEvent
  • EventPropagator
  • PostCreateModelEvent
  • PostDeleteModelEvent
  • PostDuplicateModelEvent
  • PostPasteModelEvent
  • PostPersistModelEvent
  • PreCreateModelEvent
  • PreDeleteModelEvent
  • PreDuplicateModelEvent
  • PrePasteModelEvent
  • PrePersistModelEvent

Interfaces

  • CommandEventInterface
  • EventPropagatorInterface
  • ModelCommandEventInterface
  • Overview
  • Namespace
  • Class
  • Tree
  • Deprecated
  • Todo
 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: use DcGeneral\ModelAwareInterface;
18: 
19: /**
20:  * Abstract base class for an event that need an environment and a model.
21:  *
22:  * @package DcGeneral\Event
23:  */
24: class AbstractModelAwareEvent
25:     extends AbstractEnvironmentAwareEvent
26:     implements ModelAwareInterface
27: {
28:     /**
29:      * The model attached to the event.
30:      *
31:      * @var ModelInterface
32:      */
33:     protected $model;
34: 
35:     /**
36:      * Create a new model aware event.
37:      *
38:      * @param EnvironmentInterface $environment The environment.
39:      *
40:      * @param ModelInterface       $model       The model attached to the event.
41:      */
42:     public function __construct(EnvironmentInterface $environment, ModelInterface $model)
43:     {
44:         parent::__construct($environment);
45:         $this->model = $model;
46:     }
47: 
48:     /**
49:      * {@inheritdoc}
50:      */
51:     public function getModel()
52:     {
53:         return $this->model;
54:     }
55: }
56: 
contao-community-alliance/dc-general API documentation generated by ApiGen 2.8.0