AbstractNodeData
abstract class AbstractNodeData (View source)
Some NodeData (persisted or transient)
NOTE: This class is not supposed to be subclassed by userland code. If this API is modified, make sure to also implement the additional methods inside NodeData, NodeTemplate and Node and keep NodeInterface in sync!
Properties
protected array | $properties | Properties of this Node |
|
protected ContentObjectProxy | $contentObjectProxy | An optional object which is used as a content container alternative to $properties |
|
protected string | $nodeType | The name of the node type of this node |
|
protected DateTimeInterface | $creationDateTime | ||
protected DateTimeInterface | $lastModificationDateTime | ||
protected DateTimeInterface | $lastPublicationDateTime | ||
$hidden | If this node is hidden, it is not shown in a public place |
||
$hiddenBeforeDateTime | If set, this node is automatically hidden before the specified date / time |
||
$hiddenAfterDateTime | If set, this node is automatically hidden after the specified date / time |
||
$hiddenInIndex | If this node should be hidden in indexes, such as a website navigation |
||
protected string[] | $accessRoles | List of role names which are required to access this node at all |
|
protected NodeDataRepository | $nodeDataRepository | ||
protected PersistenceManagerInterface | $persistenceManager | ||
protected NodeTypeManager | $nodeTypeManager |
Methods
Constructs this node data container
Make sure the properties are always an array.
Sets the specified property.
Checks if a property value contains an entity and persists it.
If this node has a property with the given name.
Returns the specified property.
Removes the specified property.
Returns all properties of this node.
Returns the names of all properties of this node.
Sets a content object for this node.
Returns the content object of this node (if any).
Unsets the content object of this node.
Returns the node type of this node.
No description
No description
No description
Sets the "hidden" flag for this node.
Returns the current state of the hidden flag
Sets the date and time when this node becomes potentially visible.
Returns the date and time before which this node will be automatically hidden.
Sets the date and time when this node should be automatically hidden
Returns the date and time after which this node will be automatically hidden.
Sets if this node should be hidden in indexes, such as a site navigation.
If this node should be hidden in indexes
Sets the roles which are required to access this node
Returns the names of defined access roles
By default this method does not do anything.
By default this method does not do anything.
Returns the workspace this node is contained in
Details
__construct()
Constructs this node data container
void
ensurePropertiesIsNeverNull()
Make sure the properties are always an array.
If the JSON in the DB is corrupted, decoding it can fail, leading to a null value. This may lead to errors later, when the value is used with functions that expect an array.
void
setProperty(string $propertyName, mixed $value)
Sets the specified property.
If the node has a content object attached, the property will be set there if it is settable.
protected
persistRelatedEntities(mixed $value)
Checks if a property value contains an entity and persists it.
bool
hasProperty(string $propertyName)
If this node has a property with the given name.
If the node has a content object attached, the property will be checked there.
mixed
getProperty(string $propertyName)
Returns the specified property.
If the node has a content object attached, the property will be fetched there if it is gettable.
void
removeProperty(string $propertyName)
Removes the specified property.
If the node has a content object attached, the property will not be removed on that object if it exists.
array
getProperties()
Returns all properties of this node.
If the node has a content object attached, the properties will be fetched there.
array
getPropertyNames()
Returns the names of all properties of this node.
void
setContentObject(object $contentObject)
Sets a content object for this node.
object
getContentObject()
Returns the content object of this node (if any).
void
unsetContentObject()
Unsets the content object of this node.
void
setNodeType(NodeType $nodeType)
Sets the node type of this node.
NodeType
getNodeType()
Returns the node type of this node.
DateTime
getCreationDateTime()
No description
DateTime
getLastModificationDateTime()
No description
DateTimeInterface
getLastPublicationDateTime()
No description
void
setLastPublicationDateTime(DateTimeInterface $lastPublicationDateTime = null)
No description
void
setHidden(bool $hidden)
Sets the "hidden" flag for this node.
bool
isHidden()
Returns the current state of the hidden flag
void
setHiddenBeforeDateTime(DateTimeInterface $dateTime = null)
Sets the date and time when this node becomes potentially visible.
DateTimeInterface
getHiddenBeforeDateTime()
Returns the date and time before which this node will be automatically hidden.
void
setHiddenAfterDateTime(DateTimeInterface $dateTime = null)
Sets the date and time when this node should be automatically hidden
DateTimeInterface
getHiddenAfterDateTime()
Returns the date and time after which this node will be automatically hidden.
void
setHiddenInIndex(bool $hidden)
Sets if this node should be hidden in indexes, such as a site navigation.
bool
isHiddenInIndex()
If this node should be hidden in indexes
void
setAccessRoles(array $accessRoles)
Sets the roles which are required to access this node
array
getAccessRoles()
Returns the names of defined access roles
protected void
addOrUpdate()
By default this method does not do anything.
For persisted nodes (PersistedNodeInterface) this updates the node in the node repository, for new nodes this method will add the respective node to the repository.
protected void
updateContentObject(object $contentObject)
By default this method does not do anything.
For persisted nodes (PersistedNodeInterface) this updates the content object via the PersistenceManager
abstract Workspace
getWorkspace()
Returns the workspace this node is contained in