Completed
Pull Request — master (#239)
by Luc
04:41
created

AbstractLabelCommand::getLabel()   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\Organizer\Commands;
4
5
use CultuurNet\UDB3\Label;
6
use CultuurNet\UDB3\Offer\Commands\AuthorizableCommandInterface;
7
use CultuurNet\UDB3\Role\ValueObjects\Permission;
8
use CultuurNet\UDB3\Security\LabelSecurityInterface;
9
use ValueObjects\String\String as StringLiteral;
10
11
abstract class AbstractLabelCommand extends AbstractOrganizerCommand implements AuthorizableCommandInterface, LabelSecurityInterface
12
{
13
    /**
14
     * @var Label
15
     */
16
    private $label;
17
18
    /**
19
     * @param string $organizerId
20
     * @param Label $label
21
     */
22
    public function __construct(
23
        $organizerId,
24
        Label $label
25
    ) {
26
        parent::__construct($organizerId);
27
        $this->label = $label;
28
    }
29
30
    /**
31
     * @return Label
32
     */
33
    public function getLabel()
34
    {
35
        return $this->label;
36
    }
37
38
    /**
39
     * @inheritdoc
40
     */
41
    public function getItemId()
42
    {
43
        return $this->getOrganizerId();
44
    }
45
46
    /**
47
     * @inheritdoc
48
     */
49
    public function getPermission()
50
    {
51
        return Permission::AANBOD_BEWERKEN();
52
    }
53
54
    /**
55
     * @inheritdoc
56
     */
57
    public function isIdentifiedByUuid()
58
    {
59
        return false;
60
    }
61
62
    /**
63
     * @inheritdoc
64
     */
65
    public function getName()
66
    {
67
        return new StringLiteral((string) $this->label);
68
    }
69
70
    /**
71
     * @inheritdoc
72
     */
73
    public function getUuid()
74
    {
75
        return null;
76
    }
77
}
78