Completed
Push — EZP-31383-roles-copying ( d0932a...19a821 )
by
unknown
12:30
created

Role::getStatus()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
/**
4
 * @copyright Copyright (C) eZ Systems AS. All rights reserved.
5
 * @license For full copyright and license information view LICENSE file distributed with this source code.
6
 */
7
declare(strict_types=1);
8
9
namespace eZ\Publish\API\Repository\Values\User;
10
11
use eZ\Publish\API\Repository\Values\ValueObject;
12
13
/**
14
 * This class represents a role.
15
 *
16
 * @property-read int $id the internal id of the role
17
 * @property-read string $identifier the identifier of the role
18
 *
19
 * @property-read \eZ\Publish\API\Repository\Values\User\Policy[] $policies an array of the policies {@link \eZ\Publish\API\Repository\Values\User\Policy} of the role.
20
 */
21
abstract class Role extends ValueObject
22
{
23
    /** @var int Status constant for defined (aka "published") role */
24
    const STATUS_DEFINED = 0;
25
26
    /** @var int Status constant for draft (aka "temporary") role */
27
    const STATUS_DRAFT = 1;
28
29
    /**
30
     * ID of the user role.
31
     *
32
     * @var int
33
     */
34
    protected $id;
35
36
    /**
37
     * Readable string identifier of a role
38
     * in 4.x. this is mapped to the role name.
39
     *
40
     * @var string
41
     */
42
    protected $identifier;
43
44
    /**
45
     * The status of the role.
46
     *
47
     * @var int One of Role::STATUS_DEFINED|Role::STATUS_DRAFT
48
     */
49
    protected $status;
50
51
    /**
52
     * @return int
53
     */
54
    public function getStatus(): int
55
    {
56
        return $this->status;
57
    }
58
59
    /**
60
     * Returns the list of policies of this role.
61
     *
62
     * @return \eZ\Publish\API\Repository\Values\User\Policy[]
63
     */
64
    abstract public function getPolicies(): iterable;
65
}
66