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

__construct(string $eventType, array $data, string $user = null, Event $parentEvent = null)

Create a new event

from  Event
string
getEventType()

Return the type of this event

from  Event
getTimestamp()

Return the timestamp of this event

from  Event
array
getData()

Return the payload of this event

from  Event
string
getAccountIdentifier()

Return the identifier of the account (if any) which triggered this event

from  Event
getParentEvent()

Return the parent event (if any)

from  Event
array
getChildEvents()

Return the child events (if any)

from  Event
void
addChildEvent(Event $childEvent)

Add a new child event. Is called from the child event's constructor.

from  Event
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

getDocumentNode()

Returns the closest document node, if it can be resolved.

getNode()

Returns the node this even refers to, if it can be resolved.

null|object
getCurrentSite()

Prevents invalid calls to the site repository in case the site data property is not available.

string
__toString()

No description

Details

__construct(string $eventType, array $data, string $user = null, Event $parentEvent = null)

Create a new event

Parameters

string $eventType
array $data
string $user
Event $parentEvent

string getEventType()

Return the type of this event

Return Value

string

DateTime getTimestamp()

Return the timestamp of this event

Return Value

DateTime

array getData()

Return the payload of this event

Return Value

array

string getAccountIdentifier()

Return the identifier of the account (if any) which triggered this event

Return Value

string

Event getParentEvent()

Return the parent event (if any)

Return Value

Event

array getChildEvents()

Return the child events (if any)

Return Value

array

void addChildEvent(Event $childEvent)

Add a new child event. Is called from the child event's constructor.

Parameters

Event $childEvent

Return Value

void

string getWorkspaceName()

Return name of the workspace where the node event happened

Return Value

string

bool isDocumentEvent()

No description

Return Value

bool

string getDocumentNodeIdentifier()

Return the node identifier of the closest parent document node related to this event

Return Value

string

string getNodeIdentifier()

Return the node identifier of the node this event relates to

Return Value

string

void setNode(NodeInterface $node)

Set the "context node" this operation was working on.

Parameters

NodeInterface $node

Return Value

void

void setWorkspaceName(string $workspaceName)

Override the workspace name. MUST be called after setNode(), else it won't have an effect.

Parameters

string $workspaceName

Return Value

void

static NodeInterface getClosestAggregateNode(NodeInterface $node)

Returns the closest aggregate node of the given node

Parameters

NodeInterface $node

Return Value

NodeInterface

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.

Return Value

NodeInterface

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.

Return Value

NodeInterface

protected null|object getCurrentSite()

Prevents invalid calls to the site repository in case the site data property is not available.

Return Value

null|object

string __toString()

No description

Return Value

string