ActorImportedFromUDB2::getCdbXmlNamespaceUri()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace CultuurNet\UDB3\Actor;
4
5
class ActorImportedFromUDB2 extends ActorEvent
6
{
7
    /**
8
     * @var string
9
     */
10
    protected $cdbXml;
11
12
    /**
13
     * @var string
14
     */
15
    protected $cdbXmlNamespaceUri;
16
17
    final public function __construct(string $actorId, string $cdbXml, string $cdbXmlNamespaceUri)
18
    {
19
        parent::__construct($actorId);
20
        $this->cdbXml = $cdbXml;
21
        $this->cdbXmlNamespaceUri = $cdbXmlNamespaceUri;
22
    }
23
24
    public function getCdbXml(): string
25
    {
26
        return $this->cdbXml;
27
    }
28
29
    /**
30
     * @return string
31
     */
32
    public function getCdbXmlNamespaceUri(): string
33
    {
34
        return $this->cdbXmlNamespaceUri;
35
    }
36
37
    public function serialize(): array
38
    {
39
        return parent::serialize() + array(
40
            'cdbxml' => $this->cdbXml,
41
            'cdbXmlNamespaceUri' => $this->cdbXmlNamespaceUri,
42
        );
43
    }
44
45
    public static function deserialize(array $data): ActorImportedFromUDB2
46
    {
47
        $data += array(
48
            'cdbXmlNamespaceUri' => \CultureFeed_Cdb_Xml::namespaceUriForVersion('3.2'),
49
        );
50
        return new static(
51
            $data['actor_id'],
52
            $data['cdbxml'],
53
            $data['cdbXmlNamespaceUri']
54
        );
55
    }
56
}
57