NodeEvent
class NodeEvent extends Event (View source)
A specific event which is used for ContentRepository Nodes (i.e. content).
Properties
protected DateTime | $timestamp | When was this event? |
from Event |
protected int | $uid | We introduce an auto_increment column to be able to sort events at the same timestamp |
from Event |
protected string | $eventType | What was this event about? Is a required string constant. |
from Event |
protected string | $accountIdentifier | The identifier of the account that triggered this event. Optional. |
from Event |
protected array | $data | Payload of the event. |
from Event |
protected Event | $parentEvent | The parent event, if exists. E.g. if a "move node" operation triggered a bunch of other events, or a "publish" |
from Event |
protected Event> | $childEvents | Child events, of this event |
from Event |
protected string | $nodeIdentifier | the node identifier which was created/modified/. |
|
protected string | $documentNodeIdentifier | the document node identifier on which the action took place. is equal to NodeIdentifier if the action happened on documentNodes |
|
protected string | $workspaceName | the workspace name where the action took place |
|
protected array | $dimension | the dimension values for that event |
|
protected UserService | $userService | ||
protected ContextFactoryInterface | $contextFactory | ||
protected PersistenceManagerInterface | $persistenceManager | ||
protected SiteRepository | $siteRepository |
Methods
Create a new event
Return the identifier of the account (if any) which triggered this event
Add a new child event. Is called from the child event's constructor.
Return name of the workspace where the node event happened
No description
Return the node identifier of the closest parent document node related to this event
Return the node identifier of the node this event relates to
Override the workspace name. MUST be called after setNode(), else it won't have an effect.
Returns the closest document node, if it can be resolved.
Returns the node this even refers to, if it can be resolved.
Prevents invalid calls to the site repository in case the site data property is not available.
No description
Details
in
Event at line 100
__construct(string $eventType, array $data, string $user = null, Event $parentEvent = null)
Create a new event
in
Event at line 120
string
getEventType()
Return the type of this event
in
Event at line 130
DateTime
getTimestamp()
Return the timestamp of this event
in
Event at line 140
array
getData()
Return the payload of this event
in
Event at line 150
string
getAccountIdentifier()
Return the identifier of the account (if any) which triggered this event
in
Event at line 160
Event
getParentEvent()
Return the parent event (if any)
in
Event at line 170
array
getChildEvents()
Return the child events (if any)
in
Event at line 181
void
addChildEvent(Event $childEvent)
Add a new child event. Is called from the child event's constructor.
string
getWorkspaceName()
Return name of the workspace where the node event happened
bool
isDocumentEvent()
No description
string
getDocumentNodeIdentifier()
Return the node identifier of the closest parent document node related to this event
string
getNodeIdentifier()
Return the node identifier of the node this event relates to
void
setNode(NodeInterface $node)
Set the "context node" this operation was working on.
void
setWorkspaceName(string $workspaceName)
Override the workspace name. MUST be called after setNode(), else it won't have an effect.
static NodeInterface
getClosestAggregateNode(NodeInterface $node)
Returns the closest aggregate node of the given node
NodeInterface
getDocumentNode()
Returns the closest document node, if it can be resolved.
It might happen that, if this event refers to a node contained in a site which is not available anymore, Doctrine's proxy class of the Site domain model will fail with an EntityNotFoundException. We catch this case and return NULL.
NodeInterface
getNode()
Returns the node this even refers to, if it can be resolved.
It might happen that, if this event refers to a node contained in a site which is not available anymore, Doctrine's proxy class of the Site domain model will fail with an EntityNotFoundException. We catch this case and return NULL.
protected null|object
getCurrentSite()
Prevents invalid calls to the site repository in case the site data property is not available.
string
__toString()
No description