Completed
Pull Request — master (#239)
by Luc
05:02
created

AbstractLabelCommand::isIdentifiedByUuid()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace CultuurNet\UDB3\Offer\Commands;
4
5
use CultuurNet\UDB3\Label;
6
use CultuurNet\UDB3\Security\LabelSecurityInterface;
7
use ValueObjects\String\String as 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
        $this->itemId = $itemId;
28
    }
29
30
    /**
31
     * @return string
32
     */
33
    public function getItemId()
34
    {
35
        return $this->itemId;
36
    }
37
38
    /**
39
     * @return Label
40
     */
41
    public function getLabel()
42
    {
43
        return $this->label;
44
    }
45
46
    /**
47
     * @inheritdoc
48
     */
49
    public function getName()
50
    {
51
        return new StringLiteral((string)$this->label);
52
    }
53
}
54