| Total Complexity | 12 |
| Total Lines | 145 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 31 | class EventDefinition extends AbstractDefinitionComponent implements DataPreProcessorInterface |
||
| 32 | { |
||
| 33 | use ParentsTrait; |
||
| 34 | |||
| 35 | /** |
||
| 36 | * @var string |
||
| 37 | * |
||
| 38 | * @validate NotEmpty |
||
| 39 | */ |
||
| 40 | protected $identifier; |
||
| 41 | |||
| 42 | /** |
||
| 43 | * @var string |
||
| 44 | */ |
||
| 45 | protected $label; |
||
| 46 | |||
| 47 | /** |
||
| 48 | * @var string |
||
| 49 | */ |
||
| 50 | protected $description; |
||
| 51 | |||
| 52 | /** |
||
| 53 | * @var string |
||
| 54 | * |
||
| 55 | * @validate Romm.ConfigurationObject:ClassImplements(interface=CuyZ\Notiz\Core\Event\Event) |
||
| 56 | */ |
||
| 57 | protected $className; |
||
| 58 | |||
| 59 | /** |
||
| 60 | * @var \CuyZ\Notiz\Core\Definition\Tree\EventGroup\Event\Configuration\EventConfiguration |
||
| 61 | */ |
||
| 62 | protected $configuration; |
||
| 63 | |||
| 64 | /** |
||
| 65 | * @var \CuyZ\Notiz\Core\Definition\Tree\EventGroup\Event\Connection\Connection |
||
| 66 | * |
||
| 67 | * @validate NotEmpty |
||
| 68 | * |
||
| 69 | * @mixedTypesResolver \CuyZ\Notiz\Core\Definition\Tree\EventGroup\Event\Connection\ConnectionResolver |
||
| 70 | */ |
||
| 71 | protected $connection; |
||
| 72 | |||
| 73 | /** |
||
| 74 | * @param string $identifier |
||
| 75 | * @param string $className |
||
| 76 | */ |
||
| 77 | public function __construct($identifier, $className) |
||
| 78 | { |
||
| 79 | $this->identifier = $identifier; |
||
| 80 | $this->className = $className; |
||
| 81 | } |
||
| 82 | |||
| 83 | /** |
||
| 84 | * @return string |
||
| 85 | */ |
||
| 86 | public function getIdentifier() |
||
| 87 | { |
||
| 88 | return $this->identifier; |
||
| 89 | } |
||
| 90 | |||
| 91 | /** |
||
| 92 | * Returns a full version of the identifier, containing both the event group |
||
| 93 | * identifier and the event identifier, separated by a dot. |
||
| 94 | * |
||
| 95 | * @return string |
||
| 96 | */ |
||
| 97 | public function getFullIdentifier() |
||
| 100 | } |
||
| 101 | |||
| 102 | /** |
||
| 103 | * @return string |
||
| 104 | */ |
||
| 105 | public function getLabel() |
||
| 106 | { |
||
| 107 | return LocalizationService::localize($this->label); |
||
| 108 | } |
||
| 109 | |||
| 110 | /** |
||
| 111 | * @return string |
||
| 112 | */ |
||
| 113 | public function getDescription() |
||
| 114 | { |
||
| 115 | return LocalizationService::localize($this->description); |
||
| 116 | } |
||
| 117 | |||
| 118 | /** |
||
| 119 | * @return string |
||
| 120 | */ |
||
| 121 | public function getClassName() |
||
| 122 | { |
||
| 123 | return $this->className; |
||
| 124 | } |
||
| 125 | |||
| 126 | /** |
||
| 127 | * @return EventConfiguration |
||
| 128 | */ |
||
| 129 | public function getConfiguration() |
||
| 130 | { |
||
| 131 | return $this->configuration; |
||
| 132 | } |
||
| 133 | |||
| 134 | /** |
||
| 135 | * @return Connection |
||
| 136 | */ |
||
| 137 | public function getConnection() |
||
| 140 | } |
||
| 141 | |||
| 142 | /** |
||
| 143 | * @return EventGroup |
||
| 144 | */ |
||
| 145 | public function getGroup() |
||
| 146 | { |
||
| 147 | /** @var EventGroup $eventGroup */ |
||
| 148 | $eventGroup = $this->getFirstParent(EventGroup::class); |
||
| 149 | |||
| 150 | return $eventGroup; |
||
| 151 | } |
||
| 152 | |||
| 153 | /** |
||
| 154 | * @param string $propertyClassName |
||
| 155 | * @param Notification $notification |
||
| 156 | * @return PropertyDefinition |
||
| 157 | */ |
||
| 158 | public function getPropertyDefinition($propertyClassName, Notification $notification) |
||
| 161 | } |
||
| 162 | |||
| 163 | /** |
||
| 164 | * @param DataPreProcessor $processor |
||
| 165 | */ |
||
| 166 | public static function dataPreProcessor(DataPreProcessor $processor) |
||
| 176 | } |
||
| 177 | } |
||
| 178 |