@@ 9-39 (lines=31) @@ | ||
6 | use CultuurNet\UDB3\Event\EventEvent; |
|
7 | use CultuurNet\UDB3\HasCdbXmlTrait; |
|
8 | ||
9 | class EventImportedFromUDB2 extends EventEvent implements EventCdbXMLInterface |
|
10 | { |
|
11 | use HasCdbXmlTrait; |
|
12 | ||
13 | public function __construct(string $eventId, string $cdbXml, string $cdbXmlNamespaceUri) |
|
14 | { |
|
15 | parent::__construct($eventId); |
|
16 | $this->setCdbXml($cdbXml); |
|
17 | $this->setCdbXmlNamespaceUri($cdbXmlNamespaceUri); |
|
18 | } |
|
19 | ||
20 | public function serialize(): array |
|
21 | { |
|
22 | return parent::serialize() + array( |
|
23 | 'cdbxml' => $this->getCdbXml(), |
|
24 | 'cdbXmlNamespaceUri' => $this->getCdbXmlNamespaceUri(), |
|
25 | ); |
|
26 | } |
|
27 | ||
28 | public static function deserialize(array $data): EventImportedFromUDB2 |
|
29 | { |
|
30 | $data += array( |
|
31 | 'cdbXmlNamespaceUri' => CultureFeed_Cdb_Xml::namespaceUriForVersion('3.2'), |
|
32 | ); |
|
33 | return new self( |
|
34 | $data['event_id'], |
|
35 | $data['cdbxml'], |
|
36 | $data['cdbXmlNamespaceUri'] |
|
37 | ); |
|
38 | } |
|
39 | } |
|
40 |
@@ 9-40 (lines=32) @@ | ||
6 | use CultuurNet\UDB3\Event\EventEvent; |
|
7 | use CultuurNet\UDB3\HasCdbXmlTrait; |
|
8 | ||
9 | class EventUpdatedFromUDB2 extends EventEvent implements EventCdbXMLInterface |
|
10 | { |
|
11 | use HasCdbXmlTrait; |
|
12 | ||
13 | public function __construct(string $eventId, string $cdbXml, string $cdbXmlNamespaceUri) |
|
14 | { |
|
15 | parent::__construct($eventId); |
|
16 | ||
17 | $this->setCdbXml($cdbXml); |
|
18 | $this->setCdbXmlNamespaceUri($cdbXmlNamespaceUri); |
|
19 | } |
|
20 | ||
21 | public function serialize(): array |
|
22 | { |
|
23 | return parent::serialize() + array( |
|
24 | 'cdbxml' => $this->getCdbXml(), |
|
25 | 'cdbXmlNamespaceUri' => $this->getCdbXmlNamespaceUri(), |
|
26 | ); |
|
27 | } |
|
28 | ||
29 | public static function deserialize(array $data): EventUpdatedFromUDB2 |
|
30 | { |
|
31 | $data += array( |
|
32 | 'cdbXmlNamespaceUri' => CultureFeed_Cdb_Xml::namespaceUriForVersion('3.2'), |
|
33 | ); |
|
34 | return new self( |
|
35 | $data['event_id'], |
|
36 | $data['cdbxml'], |
|
37 | $data['cdbXmlNamespaceUri'] |
|
38 | ); |
|
39 | } |
|
40 | } |
|
41 |