Completed
Push — ezp-30616 ( ab7e14...128c78 )
by
unknown
17:09
created

getUpdatedPolicyDraft()   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
declare(strict_types=1);
4
5
namespace eZ\Publish\Core\Event\Role;
6
7
use eZ\Publish\API\Repository\Values\User\PolicyDraft;
8
use eZ\Publish\API\Repository\Values\User\PolicyUpdateStruct;
9
use eZ\Publish\API\Repository\Values\User\RoleDraft;
10
use eZ\Publish\Core\Event\BeforeEvent;
11
12
final class BeforeUpdatePolicyByRoleDraftEvent extends BeforeEvent
13
{
14
	public const NAME = 'ezplatform.event.role.update_policy_by_draft.before';
15
16
	/**
17
     * @var \eZ\Publish\API\Repository\Values\User\RoleDraft
18
     */
19
	private $roleDraft;
20
21
	/**
22
     * @var \eZ\Publish\API\Repository\Values\User\PolicyDraft
23
     */
24
	private $policy;
25
26
	/**
27
     * @var \eZ\Publish\API\Repository\Values\User\PolicyUpdateStruct
28
     */
29
	private $policyUpdateStruct;
30
31
	/**
32
     * @var \eZ\Publish\API\Repository\Values\User\PolicyDraft|null
33
     */
34
	private $updatedPolicyDraft;
35
36
37
	public function __construct(RoleDraft $roleDraft, PolicyDraft $policy, PolicyUpdateStruct $policyUpdateStruct)
38
	{
39
		$this->roleDraft = $roleDraft;
40
		$this->policy = $policy;
41
		$this->policyUpdateStruct = $policyUpdateStruct;
42
	}
43
44
45
	public function getRoleDraft(): RoleDraft
46
	{
47
		return $this->roleDraft;
48
	}
49
50
51
	public function getPolicy(): PolicyDraft
52
	{
53
		return $this->policy;
54
	}
55
56
57
	public function getPolicyUpdateStruct(): PolicyUpdateStruct
58
	{
59
		return $this->policyUpdateStruct;
60
	}
61
62
63
	function getUpdatedPolicyDraft(): ?PolicyDraft
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
64
	{
65
		return $this->updatedPolicyDraft;
66
	}
67
68
69
	function setUpdatedPolicyDraft(?PolicyDraft $updatedPolicyDraft): void
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
70
	{
71
		$this->updatedPolicyDraft = $updatedPolicyDraft;
72
	}
73
74
75
	function hasUpdatedPolicyDraft(): bool
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
76
	{
77
		return $this->updatedPolicyDraft instanceof PolicyDraft;
78
	}
79
}
80