class NodeHandler extends AbstractHandler (View source)

Handle operations with nodes entities.

Properties

protected ObjectManager $objectManager from AbstractHandler

Methods

ObjectManager
getObjectManager()

No description

setObjectManager(ObjectManager $objectManager)

No description

__construct(ObjectManager $objectManager)

AbstractHandler constructor.

int
cleanPositions(bool $setPositions = true)

Clean position for current node siblings.

getNode()

No description

setNode(Node $node)

No description

$this
cleanCustomFormsFromField(NodeTypeField $field, bool $flush = true)

Remove every node to custom-forms associations for a given field.

$this
addCustomFormForField(CustomForm $customForm, NodeTypeField $field, bool $flush = true, null|integer $position = null)

Add a node to current custom-forms for a given node-type field.

array
getCustomFormsFromFieldName(string $fieldName)

Get custom forms linked to current node for a given fieldname.

$this
cleanNodesFromField(NodeTypeField $field, bool $flush = true)

Remove every node to node associations for a given field.

$this
addNodeForField(Node $node, NodeTypeField $field, bool $flush = true, null|integer $position = null)

Add a node to current node for a given node-type field.

Node[]
getNodesFromFieldName(string $fieldName)

Get nodes linked to current node for a given fieldname.

Node[]
getReverseNodesFromFieldName(string $fieldName)

Get nodes reversed-linked to current node for a given fieldname.

getNodeSourceByTranslation(Translation $translation)

Get node source by translation.

$this
removeAssociations()

Remove only current node associations.

$this
removeWithChildrenAndAssociations()

Remove current node with its children recursively and its associations.

$this
softRemoveWithChildren()

Soft delete node and its children.

$this
softUnremoveWithChildren()

Un-delete node and its children.

$this
publishWithChildren()

Publish node and its children.

$this
archiveWithChildren()

Archive node and its children.

getAvailableTranslations() deprecated

Alias for TranslationRepository::findAvailableTranslationsForNode.

array
getAvailableTranslationsId() deprecated

Alias for TranslationRepository::findAvailableTranslationsIdForNode.

getUnavailableTranslations() deprecated

Alias for TranslationRepository::findUnavailableTranslationsForNode.

array
findUnavailableTranslationIdForNode() deprecated

Alias for TranslationRepository::findUnavailableTranslationIdForNode.

bool
isRelatedToNewsletter()

Return if is in Newsletter Node.

bool
isRelatedToNode(Node $relative)

Return if part of Node offspring.

Node[]
getParents(TokenStorageInterface $tokenStorage = null)

Return every node’s parents

int
cleanChildrenPositions(bool $setPositions = true)

Reset current node children positions.

int
cleanRootNodesPositions(bool $setPositions = true)

Reset every root nodes positions.

array
getAllOffspringId()

Return all node offspring id.

$this
makeHome()

Set current node as the Home node.

duplicate() deprecated

Duplicate current node with all its children.

Node|null
getPrevious(array $criteria = null, array $order = null)

Get previous node from hierarchy.

Node|null
getNext(array $criteria = null, array $order = null)

Get next node from hierarchy.

getRepository()

No description

Details

ObjectManager getObjectManager()

Return Value

ObjectManager

AbstractHandler setObjectManager(ObjectManager $objectManager)

Parameters

ObjectManager $objectManager

Return Value

AbstractHandler

__construct(ObjectManager $objectManager)

AbstractHandler constructor.

Parameters

ObjectManager $objectManager

int cleanPositions(bool $setPositions = true)

Clean position for current node siblings.

Warning, this method does not flush.

Parameters

bool $setPositions

Return Value

int Return the next position after the last entity

Node getNode()

Return Value

Node

NodeHandler setNode(Node $node)

Parameters

Node $node

Return Value

NodeHandler

$this cleanCustomFormsFromField(NodeTypeField $field, bool $flush = true)

Remove every node to custom-forms associations for a given field.

Parameters

NodeTypeField $field
bool $flush

Return Value

$this

$this addCustomFormForField(CustomForm $customForm, NodeTypeField $field, bool $flush = true, null|integer $position = null)

Add a node to current custom-forms for a given node-type field.

Parameters

CustomForm $customForm
NodeTypeField $field
bool $flush
null|integer $position

Return Value

$this

array getCustomFormsFromFieldName(string $fieldName)

Get custom forms linked to current node for a given fieldname.

Parameters

string $fieldName Name of the node-type field

Return Value

array

$this cleanNodesFromField(NodeTypeField $field, bool $flush = true)

Remove every node to node associations for a given field.

Parameters

NodeTypeField $field
bool $flush

Return Value

$this

$this addNodeForField(Node $node, NodeTypeField $field, bool $flush = true, null|integer $position = null)

Add a node to current node for a given node-type field.

Parameters

Node $node
NodeTypeField $field
bool $flush
null|integer $position

Return Value

$this

Node[] getNodesFromFieldName(string $fieldName)

Get nodes linked to current node for a given fieldname.

Parameters

string $fieldName Name of the node-type field

Return Value

Node[]

Node[] getReverseNodesFromFieldName(string $fieldName)

Get nodes reversed-linked to current node for a given fieldname.

Parameters

string $fieldName Name of the node-type field

Return Value

Node[]

NodesSources|null getNodeSourceByTranslation(Translation $translation)

Get node source by translation.

Parameters

Translation $translation

Return Value

NodesSources|null

$this removeAssociations()

Remove only current node associations.

Return Value

$this

$this removeWithChildrenAndAssociations()

Remove current node with its children recursively and its associations.

This method DOES NOT flush objectManager

Return Value

$this

$this softRemoveWithChildren()

Soft delete node and its children.

This method does not flush!

Return Value

$this

$this softUnremoveWithChildren()

Un-delete node and its children.

This method does not flush!

Return Value

$this

$this publishWithChildren()

Publish node and its children.

This method does not flush!

Return Value

$this

$this archiveWithChildren()

Archive node and its children.

This method does not flush!

Return Value

$this

Translation[] getAvailableTranslations() deprecated

deprecated This method has no purpose here.

Alias for TranslationRepository::findAvailableTranslationsForNode.

Return Value

Translation[]

array getAvailableTranslationsId() deprecated

deprecated This method has no purpose here.

Alias for TranslationRepository::findAvailableTranslationsIdForNode.

Return Value

array

Translation[] getUnavailableTranslations() deprecated

deprecated This method has no purpose here.

Alias for TranslationRepository::findUnavailableTranslationsForNode.

Return Value

Translation[]

array findUnavailableTranslationIdForNode() deprecated

deprecated This method has no purpose here.

Alias for TranslationRepository::findUnavailableTranslationIdForNode.

Return Value

array

bool isRelatedToNewsletter()

Return if is in Newsletter Node.

Return Value

bool

bool isRelatedToNode(Node $relative)

Return if part of Node offspring.

Parameters

Node $relative

Return Value

bool

Node[] getParents(TokenStorageInterface $tokenStorage = null)

Return every node’s parents

Parameters

TokenStorageInterface $tokenStorage

Return Value

Node[]

int cleanChildrenPositions(bool $setPositions = true)

Reset current node children positions.

Warning, this method does not flush.

Parameters

bool $setPositions

Return Value

int Return the next position after the last node

int cleanRootNodesPositions(bool $setPositions = true)

Reset every root nodes positions.

Warning, this method does not flush.

Parameters

bool $setPositions

Return Value

int Return the next position after the last node

array getAllOffspringId()

Return all node offspring id.

Return Value

array

$this makeHome()

Set current node as the Home node.

Return Value

$this

Node duplicate() deprecated

deprecated Use NodeDuplicator::duplicate() instead.

Duplicate current node with all its children.

Return Value

Node

Node|null getPrevious(array $criteria = null, array $order = null)

Get previous node from hierarchy.

Parameters

array $criteria
array $order

Return Value

Node|null

Node|null getNext(array $criteria = null, array $order = null)

Get next node from hierarchy.

Parameters

array $criteria
array $order

Return Value

Node|null

NodeRepository getRepository()

Return Value

NodeRepository