Completed
Push — master ( d252f0...d75c62 )
by Jonas
22s queued 11s
created

AbstractPropertyTranslatedEvent::deserialize()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 7
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
namespace CultuurNet\UDB3\Offer\Events;
4
5
use CultuurNet\UDB3\Language;
6
7
abstract class AbstractPropertyTranslatedEvent extends AbstractEvent
8
{
9
    /**
10
     * @var Language
11
     */
12
    protected $language;
13
14
    public function __construct($itemId, Language $language)
15
    {
16
        $this->language = $language;
17
        parent::__construct($itemId);
18
    }
19
20
    public function getLanguage(): Language
21
    {
22
        return $this->language;
23
    }
24
25
    public function serialize(): array
26
    {
27
        return parent::serialize() + array(
28
            'language' => (string)$this->language->getCode(),
29
        );
30
    }
31
}
32