Completed
Push — master ( 5ace45...cd9bd4 )
by
unknown
14s queued 10s
created

AbstractLabelCommand::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 2
1
<?php
2
3
namespace CultuurNet\UDB3\Offer\Commands;
4
5
use CultuurNet\UDB3\Label;
6
use CultuurNet\UDB3\Security\LabelSecurityInterface;
7
use ValueObjects\StringLiteral\StringLiteral;
8
9
abstract class AbstractLabelCommand extends AbstractCommand implements LabelSecurityInterface
10
{
11
    /**
12
     * @var Label
13
     */
14
    protected $label;
15
16
    /**
17
     * @param $itemId
18
     *  The id of the item that is targeted by the command.
19
     *
20
     * @param Label $label
21
     *  The label that is used in the command.
22
     */
23
    public function __construct($itemId, Label $label)
24
    {
25
        parent::__construct($itemId);
26
        $this->label = $label;
27
    }
28
29
    /**
30
     * @return string
31
     */
32
    public function getItemId()
33
    {
34
        return $this->itemId;
35
    }
36
37
    /**
38
     * @return Label
39
     */
40
    public function getLabel()
41
    {
42
        return $this->label;
43
    }
44
45
    /**
46
     * @inheritdoc
47
     */
48
    public function getNames()
49
    {
50
        return [
51
            new StringLiteral((string)$this->label),
52
        ];
53
    }
54
}
55