| 1 |  |  | <?php | 
            
                                                                                                            
                            
            
                                    
            
            
                | 2 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 3 |  |  | namespace CultuurNet\UDB3\Event; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 4 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 5 |  |  | use CultuurNet\UDB3\BookingInfo; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 6 |  |  | use CultuurNet\UDB3\CalendarInterface; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 7 |  |  | use CultuurNet\UDB3\Cdb\EventItemFactory; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 8 |  |  | use CultuurNet\UDB3\Cdb\UpdateableWithCdbXmlInterface; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 9 |  |  | use CultuurNet\UDB3\CollaborationData; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 10 |  |  | use CultuurNet\UDB3\CollaborationDataCollection; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 11 |  |  | use CultuurNet\UDB3\ContactPoint; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 12 |  |  | use CultuurNet\UDB3\Event\Events\BookingInfoUpdated; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 13 |  |  | use CultuurNet\UDB3\Event\Events\CollaborationDataAdded; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 14 |  |  | use CultuurNet\UDB3\Event\Events\ContactPointUpdated; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 15 |  |  | use CultuurNet\UDB3\Event\Events\DescriptionTranslated; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 16 |  |  | use CultuurNet\UDB3\Event\Events\DescriptionUpdated; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 17 |  |  | use CultuurNet\UDB3\Event\Events\EventCdbXMLInterface; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 18 |  |  | use CultuurNet\UDB3\Event\Events\EventCreated; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 19 |  |  | use CultuurNet\UDB3\Event\Events\EventCreatedFromCdbXml; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 20 |  |  | use CultuurNet\UDB3\Event\Events\EventDeleted; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 21 |  |  | use CultuurNet\UDB3\Event\Events\EventImportedFromUDB2; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 22 |  |  | use CultuurNet\UDB3\Event\Events\EventUpdatedFromCdbXml; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 23 |  |  | use CultuurNet\UDB3\Event\Events\EventUpdatedFromUDB2; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 24 |  |  | use CultuurNet\UDB3\Event\Events\ImageAdded; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 25 |  |  | use CultuurNet\UDB3\Event\Events\ImageRemoved; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 26 |  |  | use CultuurNet\UDB3\Event\Events\ImageUpdated; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 27 |  |  | use CultuurNet\UDB3\Event\Events\LabelAdded; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 28 |  |  | use CultuurNet\UDB3\Event\Events\LabelDeleted; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 29 |  |  | use CultuurNet\UDB3\Event\Events\LabelsMerged; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 30 |  |  | use CultuurNet\UDB3\Event\Events\MainImageSelected; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 31 |  |  | use CultuurNet\UDB3\Event\Events\MajorInfoUpdated; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 32 |  |  | use CultuurNet\UDB3\Event\Events\Moderation\Approved; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 33 |  |  | use CultuurNet\UDB3\Event\Events\Moderation\FlaggedAsDuplicate; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 34 |  |  | use CultuurNet\UDB3\Event\Events\Moderation\FlaggedAsInappropriate; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 35 |  |  | use CultuurNet\UDB3\Event\Events\Moderation\Published; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 36 |  |  | use CultuurNet\UDB3\Event\Events\Moderation\Rejected; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 37 |  |  | use CultuurNet\UDB3\Event\Events\OrganizerDeleted; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 38 |  |  | use CultuurNet\UDB3\Event\Events\OrganizerUpdated; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 39 |  |  | use CultuurNet\UDB3\Event\Events\PriceInfoUpdated; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 40 |  |  | use CultuurNet\UDB3\Event\Events\TitleTranslated; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 41 |  |  | use CultuurNet\UDB3\Event\Events\TranslationApplied; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 42 |  |  | use CultuurNet\UDB3\Event\Events\TranslationDeleted; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 43 |  |  | use CultuurNet\UDB3\Event\Events\TypicalAgeRangeDeleted; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 44 |  |  | use CultuurNet\UDB3\Event\Events\TypicalAgeRangeUpdated; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 45 |  |  | use CultuurNet\UDB3\EventXmlString; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 46 |  |  | use CultuurNet\UDB3\Label; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 47 |  |  | use CultuurNet\UDB3\LabelCollection; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 48 |  |  | use CultuurNet\UDB3\Language; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 49 |  |  | use CultuurNet\UDB3\Location\Location; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 50 |  |  | use CultuurNet\UDB3\Offer\Commands\Image\AbstractUpdateImage; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 51 |  |  | use CultuurNet\UDB3\Offer\Offer; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 52 |  |  | use CultuurNet\UDB3\Media\Image; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 53 |  |  | use CultuurNet\UDB3\PriceInfo\PriceInfo; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 54 |  |  | use CultuurNet\UDB3\Offer\WorkflowStatus; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 55 |  |  | use CultuurNet\UDB3\Theme; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 56 |  |  | use CultuurNet\UDB3\Title; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 57 |  |  | use CultuurNet\UDB3\Translation; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 58 |  |  | use ValueObjects\Identity\UUID; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 59 |  |  | use ValueObjects\String\String as StringLiteral; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 60 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 61 |  |  | class Event extends Offer implements UpdateableWithCdbXmlInterface | 
            
                                                                                                            
                            
            
                                    
            
            
                | 62 |  |  | { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 63 |  |  |     protected $eventId; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 64 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 65 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 66 |  |  |      * @var Translation[] | 
            
                                                                                                            
                            
            
                                    
            
            
                | 67 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 68 |  |  |     protected $translations = []; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 69 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 70 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 71 |  |  |      * @var CollaborationDataCollection[] | 
            
                                                                                                            
                            
            
                                    
            
            
                | 72 |  |  |      *   Array of different collections, keyed by language. | 
            
                                                                                                            
                            
            
                                    
            
            
                | 73 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 74 |  |  |     protected $collaborationData; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 75 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 76 |  |  |     const MAIN_LANGUAGE_CODE = 'nl'; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 77 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 78 |  |  |     public function __construct() | 
            
                                                                                                            
                            
            
                                    
            
            
                | 79 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 80 |  |  |         parent::__construct(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 81 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 82 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 83 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 84 |  |  |      * Factory method to create a new event. | 
            
                                                                                                            
                            
            
                                    
            
            
                | 85 |  |  |      * | 
            
                                                                                                            
                            
            
                                    
            
            
                | 86 |  |  |      * @param Title $title | 
            
                                                                                                            
                            
            
                                    
            
            
                | 87 |  |  |      * @param EventType $eventType | 
            
                                                                                                            
                            
            
                                    
            
            
                | 88 |  |  |      * @param Location $location | 
            
                                                                                                            
                            
            
                                    
            
            
                | 89 |  |  |      * @param CalendarInterface $calendar | 
            
                                                                                                            
                            
            
                                    
            
            
                | 90 |  |  |      * @param Theme|null $theme | 
            
                                                                                                            
                            
            
                                    
            
            
                | 91 |  |  |      * @param \DateTimeImmutable|null $publicationDate | 
            
                                                                                                            
                            
            
                                    
            
            
                | 92 |  |  |      * | 
            
                                                                                                            
                            
            
                                    
            
            
                | 93 |  |  |      * @return Event | 
            
                                                                                                            
                            
            
                                    
            
            
                | 94 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 95 |  |  |     public static function create( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 96 |  |  |         $eventId, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 97 |  |  |         Title $title, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 98 |  |  |         EventType $eventType, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 99 |  |  |         Location $location, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 100 |  |  |         CalendarInterface $calendar, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 101 |  |  |         Theme $theme = null, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 102 |  |  |         \DateTimeImmutable $publicationDate = null | 
            
                                                                                                            
                            
            
                                    
            
            
                | 103 |  |  |     ) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 104 |  |  |         if (!is_string($eventId)) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 105 |  |  |             throw new \InvalidArgumentException( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 106 |  |  |                 'Expected eventId to be a string, received ' . gettype($eventId) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 107 |  |  |             ); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 108 |  |  |         } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 109 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 110 |  |  |         $event = new self(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 111 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 112 |  |  |         $event->apply( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 113 |  |  |             new EventCreated( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 114 |  |  |                 $eventId, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 115 |  |  |                 $title, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 116 |  |  |                 $eventType, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 117 |  |  |                 $location, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 118 |  |  |                 $calendar, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 119 |  |  |                 $theme, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 120 |  |  |                 $publicationDate | 
            
                                                                                                            
                            
            
                                    
            
            
                | 121 |  |  |             ) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 122 |  |  |         ); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 123 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 124 |  |  |         return $event; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 125 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 126 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 127 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 128 |  |  |      * @param string $eventId | 
            
                                                                                                            
                            
            
                                    
            
            
                | 129 |  |  |      * @param string $cdbXml | 
            
                                                                                                            
                            
            
                                    
            
            
                | 130 |  |  |      * @param string $cdbXmlNamespaceUri | 
            
                                                                                                            
                            
            
                                    
            
            
                | 131 |  |  |      * @return Event | 
            
                                                                                                            
                                                                
            
                                    
            
            
                | 132 |  |  |      */ | 
            
                                                                        
                            
            
                                    
            
            
                | 133 |  |  |     public static function importFromUDB2( | 
            
                                                                        
                            
            
                                    
            
            
                | 134 |  |  |         $eventId, | 
            
                                                                        
                            
            
                                    
            
            
                | 135 |  |  |         $cdbXml, | 
            
                                                                        
                            
            
                                    
            
            
                | 136 |  |  |         $cdbXmlNamespaceUri | 
            
                                                                        
                            
            
                                    
            
            
                | 137 |  |  |     ) { | 
            
                                                                        
                            
            
                                    
            
            
                | 138 |  |  |         $event = new self(); | 
            
                                                                        
                            
            
                                    
            
            
                | 139 |  |  |         $event->apply( | 
            
                                                                        
                            
            
                                    
            
            
                | 140 |  |  |             new EventImportedFromUDB2( | 
            
                                                                        
                            
            
                                    
            
            
                | 141 |  |  |                 $eventId, | 
            
                                                                        
                            
            
                                    
            
            
                | 142 |  |  |                 $cdbXml, | 
            
                                                                        
                            
            
                                    
            
            
                | 143 |  |  |                 $cdbXmlNamespaceUri | 
            
                                                                        
                            
            
                                    
            
            
                | 144 |  |  |             ) | 
            
                                                                        
                            
            
                                    
            
            
                | 145 |  |  |         ); | 
            
                                                                        
                            
            
                                    
            
            
                | 146 |  |  |  | 
            
                                                                        
                            
            
                                    
            
            
                | 147 |  |  |         return $event; | 
            
                                                                        
                            
            
                                    
            
            
                | 148 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 149 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 150 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 151 |  |  |      * @param EventXmlString $xmlString | 
            
                                                                                                            
                            
            
                                    
            
            
                | 152 |  |  |      * @param StringLiteral $eventId | 
            
                                                                                                            
                            
            
                                    
            
            
                | 153 |  |  |      * @param StringLiteral $cdbXmlNamespaceUri | 
            
                                                                                                            
                            
            
                                    
            
            
                | 154 |  |  |      * @return Event | 
            
                                                                                                            
                            
            
                                    
            
            
                | 155 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 156 |  |  |     public static function createFromCdbXml( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 157 |  |  |         StringLiteral $eventId, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 158 |  |  |         EventXmlString $xmlString, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 159 |  |  |         StringLiteral $cdbXmlNamespaceUri | 
            
                                                                                                            
                            
            
                                    
            
            
                | 160 |  |  |     ) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 161 |  |  |         $event = new self(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 162 |  |  |         $event->apply( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 163 |  |  |             new EventCreatedFromCdbXml( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 164 |  |  |                 $eventId, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 165 |  |  |                 $xmlString, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 166 |  |  |                 $cdbXmlNamespaceUri | 
            
                                                                                                            
                            
            
                                    
            
            
                | 167 |  |  |             ) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 168 |  |  |         ); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 169 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 170 |  |  |         return $event; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 171 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 172 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 173 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 174 |  |  |      * @param StringLiteral $eventId | 
            
                                                                                                            
                            
            
                                    
            
            
                | 175 |  |  |      * @param EventXmlString $xmlString | 
            
                                                                                                            
                            
            
                                    
            
            
                | 176 |  |  |      * @param StringLiteral $cdbXmlNamespaceUri | 
            
                                                                                                            
                            
            
                                    
            
            
                | 177 |  |  |      * @return Event | 
            
                                                                                                            
                            
            
                                    
            
            
                | 178 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 179 |  |  |     public function updateFromCdbXml( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 180 |  |  |         StringLiteral $eventId, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 181 |  |  |         EventXmlString $xmlString, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 182 |  |  |         StringLiteral $cdbXmlNamespaceUri | 
            
                                                                                                            
                            
            
                                    
            
            
                | 183 |  |  |     ) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 184 |  |  |         $this->apply( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 185 |  |  |             new EventUpdatedFromCdbXml( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 186 |  |  |                 $eventId, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 187 |  |  |                 $xmlString, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 188 |  |  |                 $cdbXmlNamespaceUri | 
            
                                                                                                            
                            
            
                                    
            
            
                | 189 |  |  |             ) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 190 |  |  |         ); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 191 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 192 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 193 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 194 |  |  |      * @param LabelCollection $labels | 
            
                                                                                                            
                            
            
                                    
            
            
                | 195 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 196 |  |  |     public function mergeLabels(LabelCollection $labels) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 197 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 198 |  |  |         if (count($labels) === 0) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 199 |  |  |             throw new \InvalidArgumentException( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 200 |  |  |                 'Argument $labels should contain at least one label' | 
            
                                                                                                            
                            
            
                                    
            
            
                | 201 |  |  |             ); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 202 |  |  |         } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 203 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 204 |  |  |         $this->apply( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 205 |  |  |             new LabelsMerged( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 206 |  |  |                 new StringLiteral($this->eventId), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 207 |  |  |                 $labels | 
            
                                                                                                            
                            
            
                                    
            
            
                | 208 |  |  |             ) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 209 |  |  |         ); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 210 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 211 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 212 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 213 |  |  |      * @param Language $language | 
            
                                                                                                            
                            
            
                                    
            
            
                | 214 |  |  |      * @param StringLiteral|null $title | 
            
                                                                                                            
                            
            
                                    
            
            
                | 215 |  |  |      * @param StringLiteral|null $shortDescription | 
            
                                                                                                            
                            
            
                                    
            
            
                | 216 |  |  |      * @param StringLiteral|null $longDescription | 
            
                                                                                                            
                            
            
                                    
            
            
                | 217 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 218 |  |  |     public function applyTranslation( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 219 |  |  |         Language $language, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 220 |  |  |         StringLiteral $title = null, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 221 |  |  |         StringLiteral $shortDescription = null, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 222 |  |  |         StringLiteral $longDescription = null | 
            
                                                                                                            
                            
            
                                    
            
            
                | 223 |  |  |     ) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 224 |  |  |         $this->apply( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 225 |  |  |             new TranslationApplied( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 226 |  |  |                 new StringLiteral($this->eventId), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 227 |  |  |                 $language, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 228 |  |  |                 $title, | 
                            
                    |  |  |  | 
                                                                                        
                                                                                     | 
            
                                                                                                            
                            
            
                                    
            
            
                | 229 |  |  |                 $shortDescription, | 
                            
                    |  |  |  | 
                                                                                        
                                                                                     | 
            
                                                                                                            
                            
            
                                    
            
            
                | 230 |  |  |                 $longDescription | 
                            
                    |  |  |  | 
                                                                                        
                                                                                     | 
            
                                                                                                            
                            
            
                                    
            
            
                | 231 |  |  |             ) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 232 |  |  |         ); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 233 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 234 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 235 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 236 |  |  |      * @param Language $language | 
            
                                                                                                            
                            
            
                                    
            
            
                | 237 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 238 |  |  |     public function deleteTranslation( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 239 |  |  |         Language $language | 
            
                                                                                                            
                            
            
                                    
            
            
                | 240 |  |  |     ) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 241 |  |  |         if (!array_key_exists($language->getCode(), $this->translations)) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 242 |  |  |             return; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 243 |  |  |         } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 244 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 245 |  |  |         $this->apply( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 246 |  |  |             new TranslationDeleted( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 247 |  |  |                 new StringLiteral($this->eventId), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 248 |  |  |                 $language | 
            
                                                                                                            
                            
            
                                    
            
            
                | 249 |  |  |             ) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 250 |  |  |         ); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 251 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 252 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 253 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 254 |  |  |      * @param Language $language | 
            
                                                                                                            
                            
            
                                    
            
            
                | 255 |  |  |      * @param CollaborationData $collaborationData | 
            
                                                                                                            
                            
            
                                    
            
            
                | 256 |  |  |      * @return bool | 
            
                                                                                                            
                            
            
                                    
            
            
                | 257 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 258 |  |  |     protected function isSameCollaborationDataAlreadyPresent( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 259 |  |  |         Language $language, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 260 |  |  |         CollaborationData $collaborationData | 
            
                                                                                                            
                            
            
                                    
            
            
                | 261 |  |  |     ) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 262 |  |  |         if (!isset($this->collaborationData[$language->getCode()])) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 263 |  |  |             return false; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 264 |  |  |         } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 265 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 266 |  |  |         $languageCollaborationData = $this->collaborationData[$language->getCode()]; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 267 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 268 |  |  |         return $languageCollaborationData->contains($collaborationData); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 269 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 270 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 271 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 272 |  |  |      * @param Language $language | 
            
                                                                                                            
                            
            
                                    
            
            
                | 273 |  |  |      * @param \CultuurNet\UDB3\CollaborationData $collaborationData | 
            
                                                                                                            
                            
            
                                    
            
            
                | 274 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 275 |  |  |     public function addCollaborationData( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 276 |  |  |         Language $language, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 277 |  |  |         CollaborationData $collaborationData | 
            
                                                                                                            
                            
            
                                    
            
            
                | 278 |  |  |     ) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 279 |  |  |         if ($this->isSameCollaborationDataAlreadyPresent($language, $collaborationData)) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 280 |  |  |             return; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 281 |  |  |         } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 282 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 283 |  |  |         $collaborationDataAdded = new CollaborationDataAdded( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 284 |  |  |             new StringLiteral($this->eventId), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 285 |  |  |             $language, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 286 |  |  |             $collaborationData | 
            
                                                                                                            
                            
            
                                    
            
            
                | 287 |  |  |         ); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 288 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 289 |  |  |         $this->apply($collaborationDataAdded); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 290 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 291 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 292 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 293 |  |  |      * {@inheritdoc} | 
            
                                                                                                            
                            
            
                                    
            
            
                | 294 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 295 |  |  |     public function getAggregateRootId() | 
            
                                                                                                            
                            
            
                                    
            
            
                | 296 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 297 |  |  |         return $this->eventId; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 298 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 299 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 300 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 301 |  |  |      * @return Translation[] | 
            
                                                                                                            
                            
            
                                    
            
            
                | 302 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 303 |  |  |     public function getTranslations() | 
            
                                                                                                            
                            
            
                                    
            
            
                | 304 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 305 |  |  |         return $this->translations; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 306 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 307 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 308 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 309 |  |  |      * @return UUID[] | 
            
                                                                                                            
                            
            
                                    
            
            
                | 310 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 311 |  |  |     public function getMediaObjects() | 
            
                                                                                                            
                            
            
                                    
            
            
                | 312 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 313 |  |  |         return $this->mediaObjects; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 314 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 315 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 316 |  |  |     protected function applyEventCreated(EventCreated $eventCreated) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 317 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 318 |  |  |         $this->eventId = $eventCreated->getEventId(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 319 |  |  |         $this->workflowStatus = WorkflowStatus::DRAFT(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 320 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 321 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 322 |  |  |     protected function applyEventImportedFromUDB2( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 323 |  |  |         EventImportedFromUDB2 $eventImported | 
            
                                                                                                            
                            
            
                                    
            
            
                | 324 |  |  |     ) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 325 |  |  |         $this->eventId = $eventImported->getEventId(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 326 |  |  |         $this->setUDB2Data($eventImported); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 327 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 328 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 329 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 330 |  |  |      * @param EventUpdatedFromUDB2 $eventUpdated | 
            
                                                                                                            
                            
            
                                    
            
            
                | 331 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 332 |  |  |     protected function applyEventUpdatedFromUDB2( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 333 |  |  |         EventUpdatedFromUDB2 $eventUpdated | 
            
                                                                                                            
                            
            
                                    
            
            
                | 334 |  |  |     ) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 335 |  |  |         $this->setUDB2Data($eventUpdated); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 336 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 337 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 338 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 339 |  |  |      * @param EventCdbXMLInterface $eventCdbXML | 
            
                                                                                                            
                            
            
                                    
            
            
                | 340 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 341 |  |  |     protected function setUDB2Data( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 342 |  |  |         EventCdbXMLInterface $eventCdbXML | 
            
                                                                                                            
                            
            
                                    
            
            
                | 343 |  |  |     ) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 344 |  |  |         $udb2Event = EventItemFactory::createEventFromCdbXml( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 345 |  |  |             $eventCdbXML->getCdbXmlNamespaceUri(), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 346 |  |  |             $eventCdbXML->getCdbXml() | 
            
                                                                                                            
                            
            
                                    
            
            
                | 347 |  |  |         ); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 348 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 349 |  |  |         $this->importWorkflowStatus($udb2Event); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 350 |  |  |         $this->setLabelsFromUDB2Item($udb2Event); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 351 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 352 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 353 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 354 |  |  |      * Update the major info. | 
            
                                                                                                            
                            
            
                                    
            
            
                | 355 |  |  |      * | 
            
                                                                                                            
                            
            
                                    
            
            
                | 356 |  |  |      * @param Title $title | 
            
                                                                                                            
                            
            
                                    
            
            
                | 357 |  |  |      * @param EventType $eventType | 
            
                                                                                                            
                            
            
                                    
            
            
                | 358 |  |  |      * @param Location $location | 
            
                                                                                                            
                            
            
                                    
            
            
                | 359 |  |  |      * @param CalendarInterface $calendar | 
            
                                                                                                            
                            
            
                                    
            
            
                | 360 |  |  |      * @param type $theme | 
            
                                                                                                            
                            
            
                                    
            
            
                | 361 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 362 |  |  |     public function updateMajorInfo( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 363 |  |  |         Title $title, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 364 |  |  |         EventType $eventType, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 365 |  |  |         Location $location, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 366 |  |  |         CalendarInterface $calendar, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 367 |  |  |         $theme = null | 
            
                                                                                                            
                            
            
                                    
            
            
                | 368 |  |  |     ) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 369 |  |  |         $this->apply(new MajorInfoUpdated($this->eventId, $title, $eventType, $location, $calendar, $theme)); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 370 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 371 |  |  |  | 
            
                                                                                                            
                            
            
                                                                    
                                                                                                        
            
            
                | 372 |  | View Code Duplication |     protected function applyEventCreatedFromCdbXml( | 
                            
                    |  |  |  | 
                                                                                        
                                                                                     | 
            
                                                                                                            
                            
            
                                    
            
            
                | 373 |  |  |         EventCreatedFromCdbXml $eventCreatedFromCdbXml | 
            
                                                                                                            
                            
            
                                    
            
            
                | 374 |  |  |     ) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 375 |  |  |         $this->eventId = $eventCreatedFromCdbXml->getEventId()->toNative(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 376 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 377 |  |  |         $udb2Event = EventItemFactory::createEventFromCdbXml( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 378 |  |  |             $eventCreatedFromCdbXml->getCdbXmlNamespaceUri(), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 379 |  |  |             $eventCreatedFromCdbXml->getEventXmlString()->toEventXmlString() | 
            
                                                                                                            
                            
            
                                    
            
            
                | 380 |  |  |         ); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 381 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 382 |  |  |         $this->setLabelsFromUDB2Item($udb2Event); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 383 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 384 |  |  |  | 
            
                                                                                                            
                            
            
                                                                    
                                                                                                        
            
            
                | 385 |  | View Code Duplication |     protected function applyEventUpdatedFromCdbXml( | 
                            
                    |  |  |  | 
                                                                                        
                                                                                     | 
            
                                                                                                            
                            
            
                                    
            
            
                | 386 |  |  |         EventUpdatedFromCdbXml $eventUpdatedFromCdbXml | 
            
                                                                                                            
                            
            
                                    
            
            
                | 387 |  |  |     ) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 388 |  |  |         $this->eventId = $eventUpdatedFromCdbXml->getEventId()->toNative(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 389 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 390 |  |  |         $udb2Event = EventItemFactory::createEventFromCdbXml( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 391 |  |  |             $eventUpdatedFromCdbXml->getCdbXmlNamespaceUri(), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 392 |  |  |             $eventUpdatedFromCdbXml->getEventXmlString()->toEventXmlString() | 
            
                                                                                                            
                            
            
                                    
            
            
                | 393 |  |  |         ); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 394 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 395 |  |  |         $this->setLabelsFromUDB2Item($udb2Event); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 396 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 397 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 398 |  |  |     protected function applyLabelsMerged( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 399 |  |  |         LabelsMerged $labelsMerged | 
            
                                                                                                            
                            
            
                                    
            
            
                | 400 |  |  |     ) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 401 |  |  |         $this->labels = $this->labels->merge($labelsMerged->getLabels()); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 402 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 403 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 404 |  |  |     protected function applyTranslationApplied( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 405 |  |  |         TranslationApplied $translationApplied | 
            
                                                                                                            
                            
            
                                    
            
            
                | 406 |  |  |     ) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 407 |  |  |         $this->eventId = $translationApplied->getEventId()->toNative(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 408 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 409 |  |  |         $language = $translationApplied->getLanguage()->getCode(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 410 |  |  |         $translation = new Translation( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 411 |  |  |             $translationApplied->getLanguage(), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 412 |  |  |             $translationApplied->getTitle(), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 413 |  |  |             $translationApplied->getShortdescription(), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 414 |  |  |             $translationApplied->getLongdescription() | 
            
                                                                                                            
                            
            
                                    
            
            
                | 415 |  |  |         ); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 416 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 417 |  |  |         if (!array_key_exists($language, $this->translations)) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 418 |  |  |             $this->translations[$language] = $translation; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 419 |  |  |         } else { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 420 |  |  |             $newTranslation = $this->translations[$language]->mergeTranslation($translation); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 421 |  |  |             $this->translations[$language] = $newTranslation; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 422 |  |  |         } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 423 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 424 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 425 |  |  |     protected function applyTranslationDeleted( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 426 |  |  |         TranslationDeleted $translationDeleted | 
            
                                                                                                            
                            
            
                                    
            
            
                | 427 |  |  |     ) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 428 |  |  |         $language = $translationDeleted->getLanguage()->getCode(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 429 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 430 |  |  |         if (array_key_exists($language, $this->translations)) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 431 |  |  |             unset($this->translations[$language]); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 432 |  |  |         } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 433 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 434 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 435 |  |  |     protected function applyCollaborationDataAdded( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 436 |  |  |         CollaborationDataAdded $collaborationDataAdded | 
            
                                                                                                            
                            
            
                                    
            
            
                | 437 |  |  |     ) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 438 |  |  |         $language = $collaborationDataAdded->getLanguage()->getCode(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 439 |  |  |         $collaborationData = $collaborationDataAdded->getCollaborationData(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 440 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 441 |  |  |         if (!isset($this->collaborationData[$language])) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 442 |  |  |             $this->collaborationData[$language] = new CollaborationDataCollection(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 443 |  |  |         } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 444 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 445 |  |  |         if ($this->collaborationData[$language]->contains($collaborationData)) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 446 |  |  |             return; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 447 |  |  |         } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 448 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 449 |  |  |         $this->collaborationData[$language] = $this->collaborationData[$language] | 
            
                                                                                                            
                            
            
                                    
            
            
                | 450 |  |  |             ->withKey( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 451 |  |  |                 $collaborationData->getSubBrand()->toNative(), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 452 |  |  |                 $collaborationData | 
            
                                                                                                            
                            
            
                                    
            
            
                | 453 |  |  |             ); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 454 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 455 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 456 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 457 |  |  |      * @inheritdoc | 
            
                                                                                                            
                            
            
                                    
            
            
                | 458 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 459 |  |  |     public function updateWithCdbXml($cdbXml, $cdbXmlNamespaceUri) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 460 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 461 |  |  |         $this->apply( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 462 |  |  |             new EventUpdatedFromUDB2( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 463 |  |  |                 $this->eventId, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 464 |  |  |                 $cdbXml, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 465 |  |  |                 $cdbXmlNamespaceUri | 
            
                                                                                                            
                            
            
                                    
            
            
                | 466 |  |  |             ) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 467 |  |  |         ); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 468 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 469 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 470 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 471 |  |  |      * @param Label $label | 
            
                                                                                                            
                            
            
                                    
            
            
                | 472 |  |  |      * @return LabelAdded | 
            
                                                                                                            
                            
            
                                    
            
            
                | 473 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 474 |  |  |     protected function createLabelAddedEvent(Label $label) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 475 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 476 |  |  |         return new LabelAdded($this->eventId, $label); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 477 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 478 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 479 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 480 |  |  |      * @param Label $label | 
            
                                                                                                            
                            
            
                                    
            
            
                | 481 |  |  |      * @return LabelDeleted | 
            
                                                                                                            
                            
            
                                    
            
            
                | 482 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 483 |  |  |     protected function createLabelDeletedEvent(Label $label) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 484 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 485 |  |  |         return new LabelDeleted($this->eventId, $label); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 486 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 487 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 488 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 489 |  |  |      * @param Image $image | 
            
                                                                                                            
                            
            
                                    
            
            
                | 490 |  |  |      * @return ImageAdded | 
            
                                                                                                            
                            
            
                                    
            
            
                | 491 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 492 |  |  |     protected function createImageAddedEvent(Image $image) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 493 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 494 |  |  |         return new ImageAdded($this->eventId, $image); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 495 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 496 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 497 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 498 |  |  |      * @param Image $image | 
            
                                                                                                            
                            
            
                                    
            
            
                | 499 |  |  |      * @return ImageRemoved | 
            
                                                                                                            
                            
            
                                    
            
            
                | 500 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 501 |  |  |     protected function createImageRemovedEvent(Image $image) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 502 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 503 |  |  |         return new ImageRemoved($this->eventId, $image); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 504 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 505 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 506 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 507 |  |  |      * @param AbstractUpdateImage $updateImageCommand | 
            
                                                                                                            
                            
            
                                    
            
            
                | 508 |  |  |      * @return ImageUpdated | 
            
                                                                                                            
                            
            
                                    
            
            
                | 509 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 510 |  |  |     protected function createImageUpdatedEvent( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 511 |  |  |         AbstractUpdateImage $updateImageCommand | 
            
                                                                                                            
                            
            
                                    
            
            
                | 512 |  |  |     ) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 513 |  |  |         return new ImageUpdated( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 514 |  |  |             $this->eventId, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 515 |  |  |             $updateImageCommand->getMediaObjectId(), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 516 |  |  |             $updateImageCommand->getDescription(), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 517 |  |  |             $updateImageCommand->getCopyrightHolder() | 
            
                                                                                                            
                            
            
                                    
            
            
                | 518 |  |  |         ); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 519 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 520 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 521 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 522 |  |  |      * @param Image $image | 
            
                                                                                                            
                            
            
                                    
            
            
                | 523 |  |  |      * @return MainImageSelected | 
            
                                                                                                            
                            
            
                                    
            
            
                | 524 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 525 |  |  |     protected function createMainImageSelectedEvent(Image $image) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 526 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 527 |  |  |         return new MainImageSelected($this->eventId, $image); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 528 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 529 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 530 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 531 |  |  |      * @param Language $language | 
            
                                                                                                            
                            
            
                                    
            
            
                | 532 |  |  |      * @param StringLiteral $title | 
            
                                                                                                            
                            
            
                                    
            
            
                | 533 |  |  |      * @return TitleTranslated | 
            
                                                                                                            
                            
            
                                    
            
            
                | 534 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 535 |  |  |     protected function createTitleTranslatedEvent(Language $language, StringLiteral $title) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 536 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 537 |  |  |         return new TitleTranslated($this->eventId, $language, $title); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 538 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 539 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 540 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 541 |  |  |      * @param Language $language | 
            
                                                                                                            
                            
            
                                    
            
            
                | 542 |  |  |      * @param StringLiteral $description | 
            
                                                                                                            
                            
            
                                    
            
            
                | 543 |  |  |      * @return DescriptionTranslated | 
            
                                                                                                            
                            
            
                                    
            
            
                | 544 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 545 |  |  |     protected function createDescriptionTranslatedEvent(Language $language, StringLiteral $description) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 546 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 547 |  |  |         return new DescriptionTranslated($this->eventId, $language, $description); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 548 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 549 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 550 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 551 |  |  |      * @param string $description | 
            
                                                                                                            
                            
            
                                    
            
            
                | 552 |  |  |      * @return DescriptionUpdated | 
            
                                                                                                            
                            
            
                                    
            
            
                | 553 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 554 |  |  |     protected function createDescriptionUpdatedEvent($description) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 555 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 556 |  |  |         return new DescriptionUpdated($this->eventId, $description); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 557 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 558 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 559 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 560 |  |  |      * @param string $typicalAgeRange | 
            
                                                                                                            
                            
            
                                    
            
            
                | 561 |  |  |      * @return TypicalAgeRangeUpdated | 
            
                                                                                                            
                            
            
                                    
            
            
                | 562 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 563 |  |  |     protected function createTypicalAgeRangeUpdatedEvent($typicalAgeRange) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 564 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 565 |  |  |         return new TypicalAgeRangeUpdated($this->eventId, $typicalAgeRange); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 566 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 567 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 568 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 569 |  |  |      * @return TypicalAgeRangeDeleted | 
            
                                                                                                            
                            
            
                                    
            
            
                | 570 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 571 |  |  |     protected function createTypicalAgeRangeDeletedEvent() | 
            
                                                                                                            
                            
            
                                    
            
            
                | 572 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 573 |  |  |         return new TypicalAgeRangeDeleted($this->eventId); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 574 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 575 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 576 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 577 |  |  |      * @param string $organizerId | 
            
                                                                                                            
                            
            
                                    
            
            
                | 578 |  |  |      * @return OrganizerUpdated | 
            
                                                                                                            
                            
            
                                    
            
            
                | 579 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 580 |  |  |     protected function createOrganizerUpdatedEvent($organizerId) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 581 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 582 |  |  |         return new OrganizerUpdated($this->eventId, $organizerId); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 583 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 584 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 585 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 586 |  |  |      * @param string $organizerId | 
            
                                                                                                            
                            
            
                                    
            
            
                | 587 |  |  |      * @return OrganizerDeleted | 
            
                                                                                                            
                            
            
                                    
            
            
                | 588 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 589 |  |  |     protected function createOrganizerDeletedEvent($organizerId) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 590 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 591 |  |  |         return new OrganizerDeleted($this->eventId, $organizerId); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 592 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 593 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 594 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 595 |  |  |      * @param ContactPoint $contactPoint | 
            
                                                                                                            
                            
            
                                    
            
            
                | 596 |  |  |      * @return ContactPointUpdated | 
            
                                                                                                            
                            
            
                                    
            
            
                | 597 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 598 |  |  |     protected function createContactPointUpdatedEvent(ContactPoint $contactPoint) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 599 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 600 |  |  |         return new ContactPointUpdated($this->eventId, $contactPoint); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 601 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 602 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 603 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 604 |  |  |      * @param BookingInfo $bookingInfo | 
            
                                                                                                            
                            
            
                                    
            
            
                | 605 |  |  |      * @return BookingInfoUpdated | 
            
                                                                                                            
                            
            
                                    
            
            
                | 606 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 607 |  |  |     protected function createBookingInfoUpdatedEvent(BookingInfo $bookingInfo) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 608 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 609 |  |  |         return new BookingInfoUpdated($this->eventId, $bookingInfo); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 610 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 611 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 612 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 613 |  |  |      * @param PriceInfo $priceInfo | 
            
                                                                                                            
                            
            
                                    
            
            
                | 614 |  |  |      * @return PriceInfoUpdated | 
            
                                                                                                            
                            
            
                                    
            
            
                | 615 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 616 |  |  |     protected function createPriceInfoUpdatedEvent(PriceInfo $priceInfo) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 617 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 618 |  |  |         return new PriceInfoUpdated($this->eventId, $priceInfo); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 619 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 620 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 621 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 622 |  |  |      * @return EventDeleted | 
            
                                                                                                            
                            
            
                                    
            
            
                | 623 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 624 |  |  |     protected function createOfferDeletedEvent() | 
            
                                                                                                            
                            
            
                                    
            
            
                | 625 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 626 |  |  |         return new EventDeleted($this->eventId); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 627 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 628 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 629 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 630 |  |  |      * @inheritdoc | 
            
                                                                                                            
                            
            
                                    
            
            
                | 631 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 632 |  |  |     protected function createPublishedEvent(\DateTimeInterface $publicationDate) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 633 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 634 |  |  |         return new Published($this->eventId, $publicationDate); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 635 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 636 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 637 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 638 |  |  |      * @inheritdoc | 
            
                                                                                                            
                            
            
                                    
            
            
                | 639 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 640 |  |  |     protected function createApprovedEvent() | 
            
                                                                                                            
                            
            
                                    
            
            
                | 641 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 642 |  |  |         return new Approved($this->eventId); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 643 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 644 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 645 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 646 |  |  |      * @inheritdoc | 
            
                                                                                                            
                            
            
                                    
            
            
                | 647 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 648 |  |  |     protected function createRejectedEvent(StringLiteral $reason) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 649 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 650 |  |  |         return new Rejected($this->eventId, $reason); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 651 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 652 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 653 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 654 |  |  |      * @inheritDoc | 
            
                                                                                                            
                            
            
                                    
            
            
                | 655 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 656 |  |  |     protected function createFlaggedAsDuplicate() | 
            
                                                                                                            
                            
            
                                    
            
            
                | 657 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 658 |  |  |         return new FlaggedAsDuplicate($this->eventId); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 659 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 660 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 661 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 662 |  |  |      * @inheritDoc | 
            
                                                                                                            
                            
            
                                    
            
            
                | 663 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 664 |  |  |     protected function createFlaggedAsInappropriate() | 
            
                                                                                                            
                            
            
                                    
            
            
                | 665 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 666 |  |  |         return new FlaggedAsInappropriate($this->eventId); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 667 |  |  |     } | 
            
                                                                                                            
                                                                
            
                                    
            
            
                | 668 |  |  | } | 
            
                                                        
            
                                    
            
            
                | 669 |  |  |  | 
            
                        
This check looks at variables that have been passed in as parameters and are passed out again to other methods.
If the outgoing method call has stricter type requirements than the method itself, an issue is raised.
An additional type check may prevent trouble.