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

AbstractLabelCommand::getPermission()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 4
rs 10
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\StringLiteral\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 getNames()
50
    {
51
        return [
52
            new StringLiteral((string) $this->label),
53
        ];
54
    }
55
56
    public function getPermission()
57
    {
58
        return Permission::AANBOD_BEWERKEN();
59
    }
60
}
61