|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
declare(strict_types=1); |
|
4
|
|
|
|
|
5
|
|
|
namespace eZ\Publish\Core\Event\ObjectState; |
|
6
|
|
|
|
|
7
|
|
|
use eZ\Publish\API\Repository\Values\ObjectState\ObjectStateGroup; |
|
8
|
|
|
use eZ\Publish\API\Repository\Values\ObjectState\ObjectStateGroupUpdateStruct; |
|
9
|
|
|
use eZ\Publish\Core\Event\BeforeEvent; |
|
10
|
|
|
|
|
11
|
|
|
final class BeforeUpdateObjectStateGroupEvent extends BeforeEvent |
|
12
|
|
|
{ |
|
13
|
|
|
public const NAME = 'ezplatform.event.object_state_group.update.before'; |
|
14
|
|
|
|
|
15
|
|
|
/** |
|
16
|
|
|
* @var \eZ\Publish\API\Repository\Values\ObjectState\ObjectStateGroup |
|
17
|
|
|
*/ |
|
18
|
|
|
private $objectStateGroup; |
|
19
|
|
|
|
|
20
|
|
|
/** |
|
21
|
|
|
* @var \eZ\Publish\API\Repository\Values\ObjectState\ObjectStateGroupUpdateStruct |
|
22
|
|
|
*/ |
|
23
|
|
|
private $objectStateGroupUpdateStruct; |
|
24
|
|
|
|
|
25
|
|
|
/** |
|
26
|
|
|
* @var \eZ\Publish\API\Repository\Values\ObjectState\ObjectStateGroup|null |
|
27
|
|
|
*/ |
|
28
|
|
|
private $updatedObjectStateGroup; |
|
29
|
|
|
|
|
30
|
|
|
|
|
31
|
|
|
public function __construct(ObjectStateGroup $objectStateGroup, ObjectStateGroupUpdateStruct $objectStateGroupUpdateStruct) |
|
32
|
|
|
{ |
|
33
|
|
|
$this->objectStateGroup = $objectStateGroup; |
|
34
|
|
|
$this->objectStateGroupUpdateStruct = $objectStateGroupUpdateStruct; |
|
35
|
|
|
} |
|
36
|
|
|
|
|
37
|
|
|
|
|
38
|
|
|
public function getObjectStateGroup(): ObjectStateGroup |
|
39
|
|
|
{ |
|
40
|
|
|
return $this->objectStateGroup; |
|
41
|
|
|
} |
|
42
|
|
|
|
|
43
|
|
|
|
|
44
|
|
|
public function getObjectStateGroupUpdateStruct(): ObjectStateGroupUpdateStruct |
|
45
|
|
|
{ |
|
46
|
|
|
return $this->objectStateGroupUpdateStruct; |
|
47
|
|
|
} |
|
48
|
|
|
|
|
49
|
|
|
|
|
50
|
|
|
function getUpdatedObjectStateGroup(): ?ObjectStateGroup |
|
|
|
|
|
|
51
|
|
|
{ |
|
52
|
|
|
return $this->updatedObjectStateGroup; |
|
53
|
|
|
} |
|
54
|
|
|
|
|
55
|
|
|
|
|
56
|
|
|
function setUpdatedObjectStateGroup(?ObjectStateGroup $updatedObjectStateGroup): void |
|
|
|
|
|
|
57
|
|
|
{ |
|
58
|
|
|
$this->updatedObjectStateGroup = $updatedObjectStateGroup; |
|
59
|
|
|
} |
|
60
|
|
|
|
|
61
|
|
|
|
|
62
|
|
|
function hasUpdatedObjectStateGroup(): bool |
|
|
|
|
|
|
63
|
|
|
{ |
|
64
|
|
|
return $this->updatedObjectStateGroup instanceof ObjectStateGroup; |
|
65
|
|
|
} |
|
66
|
|
|
} |
|
67
|
|
|
|
Adding explicit visibility (
private,protected, orpublic) is generally recommend to communicate to other developers how, and from where this method is intended to be used.