Completed
Push — EZP-31383 ( 83ce0c )
by
unknown
19:12
created

RoleCopyStruct   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 27
c 0
b 0
f 0
rs 10
wmc 2
lcom 1
cbo 1

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getPolicies() 0 4 1
A addPolicy() 0 4 1
1
<?php
2
3
/**
4
 * File containing the eZ\Publish\Core\Repository\Values\User\RoleCopyStruct class.
5
 *
6
 * @copyright Copyright (C) eZ Systems AS. All rights reserved.
7
 * @license For full copyright and license information view LICENSE file distributed with this source code.
8
 */
9
namespace eZ\Publish\Core\Repository\Values\User;
10
11
use eZ\Publish\API\Repository\Values\User\PolicyCreateStruct as APIPolicyCreateStruct;
12
use eZ\Publish\API\Repository\Values\User\RoleCopyStruct as APIRoleCopyStruct;
13
14
/**
15
 * This class is used to create a new role.
16
 *
17
 * @internal Meant for internal use by Repository, type hint against API instead.
18
 */
19
class RoleCopyStruct extends APIRoleCopyStruct
20
{
21
    /**
22
     * Policies associated with the role.
23
     *
24
     * @var \eZ\Publish\API\Repository\Values\User\PolicyCreateStruct[]
25
     */
26
    protected $policies = [];
27
28
    /**
29
     * Returns policies associated with the role.
30
     *
31
     * @return \eZ\Publish\API\Repository\Values\User\PolicyCreateStruct[]
32
     */
33
    public function getPolicies()
34
    {
35
        return $this->policies;
36
    }
37
38
    /**
39
     * Adds a policy to this role.
40
     */
41
    public function addPolicy(APIPolicyCreateStruct $policyCopy)
42
    {
43
        $this->policies[] = $policyCopy;
44
    }
45
}
46