Timestamps
final class Timestamps (View source)
Creation and modification timestamps of a node
created: Date and time a node was created in its content streamoriginalCreated: Date and time a node was created originally (this is equal tocreatedfor nodes in the original content stream)lastModified: Date and time a node was last modified in its content stream (NULL = never modified)originalLastModifiedDate and time a node was last modified in its original content stream
When a node is originally created via one of the following events:
- {\Neos\ContentRepository\Core\Projection\ContentGraph\RootNodeAggregateWithNodeWasCreated}
- {\Neos\ContentRepository\Core\Projection\ContentGraph\NodeAggregateWithNodeWasCreated}
the
createdandoriginalCreatedvalues are set to the current date and time.
When the creation even is re-applied on a different content stream (i.e. when publishing a node initially) or when a node variant is created via one of the following events:
- {\Neos\ContentRepository\Core\Projection\ContentGraph\NodeSpecializationVariantWasCreated}
- {\Neos\ContentRepository\Core\Projection\ContentGraph\NodeGeneralizationVariantWasCreated}
- {\Neos\ContentRepository\Core\Projection\ContentGraph\NodePeerVariantWasCreated}
the
createdvalue is set to the current date and time while theoriginalCreatedvalue is copied over from the already existing node.
The lastModified and originalLastModified values will be NULL upon creation. This allows for checking whether a node has been modified
at all.
When a node is being modified via one of the following events:
- {\Neos\ContentRepository\Core\Projection\ContentGraph\NodeAggregateNameWasChanged}
- {\Neos\ContentRepository\Core\Projection\ContentGraph\NodePropertiesWereSet}
- {\Neos\ContentRepository\Core\Projection\ContentGraph\NodeReferencesWereSet}
- {\Neos\ContentRepository\Core\Projection\ContentGraph\NodeAggregateTypeWasChanged}
the
lastModifiedis set to the current date and time. theoriginalLastModifiedvalue is also set to the current date and time if the node is modified in the original content stream. Otherwise, it is copied over from the original event
To order nodes by their timestamps, the {\Neos\ContentRepository\Core\Projection\ContentGraph\TimestampField} can be used (Ordering)
Methods
No description
Returns a new copy with the specified new values
Details
static Timestamps
create(DateTimeImmutable $created, DateTimeImmutable $originalCreated, DateTimeImmutable|null $lastModified, DateTimeImmutable|null $originalLastModified)
No description
Timestamps
with(DateTimeImmutable|null $created = null, DateTimeImmutable|null $originalCreated = null, DateTimeImmutable|null $lastModified = null, DateTimeImmutable|null $originalLastModified = null)
Returns a new copy with the specified new values
Note: The signature of this method might be extended in the future, so it should always be used with named arguments