-
Notifications
You must be signed in to change notification settings - Fork 213
Expand file tree
/
Copy pathEntityActionEventInterface.php
More file actions
106 lines (91 loc) · 2.14 KB
/
Copy pathEntityActionEventInterface.php
File metadata and controls
106 lines (91 loc) · 2.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
<?php
namespace Drupal\next\Event;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Url;
/**
* Defines an interface for entity action events.
*/
interface EntityActionEventInterface {
/**
* The entity insert action.
*/
public const INSERT_ACTION = 'insert';
/**
* The entity update action.
*/
public const UPDATE_ACTION = 'update';
/**
* The entity delete action.
*
* We use predelete because we need access to the entity for revalidating.
*/
public const DELETE_ACTION = 'delete';
/**
* Get the entity for the action.
*
* @return \Drupal\Core\Entity\EntityInterface
* The entity
*/
public function getEntity(): EntityInterface;
/**
* Sets the entity for the action.
*
* @param \Drupal\Core\Entity\EntityInterface $entity
* The entity.
*
* @return \Drupal\next\Event\EntityActionEventInterface
* The event entity.
*/
public function setEntity(EntityInterface $entity): self;
/**
* Get the sites for the entity.
*
* @return \Drupal\next\Entity\NextSiteInterface[]
* The sites for the entity.
*/
public function getSites(): array;
/**
* Sets the sites.
*
* @param \Drupal\next\Entity\NextSiteInterface[] $sites
* An array of next_site entities.
*
* @return \Drupal\next\Event\EntityActionEventInterface
* The event entity.
*/
public function setSites(array $sites): self;
/**
* Get the action for the entity.
*
* @return string
* The action.
*/
public function getAction(): string;
/**
* Sets the action.
*
* @param string $action
* The action.
*
* @return \Drupal\next\Event\EntityActionEventInterface
* The event entity.
*/
public function setAction(string $action): self;
/**
* Gets the url for the entity.
*
* @return \Drupal\Core\Url|null
* The entity url.
*/
public function getEntityUrl(): ?Url;
/**
* Sets the url for the entity.
*
* @param \Drupal\Core\Url $url
* The entity url.
*
* @return \Drupal\next\Event\EntityActionEventInterface
* The event entity.
*/
public function setEntityUrl(Url $url): self;
}