Beta version

class NodeHandler

Handle operations with nodes entities.

Methods

getNode()

No description

$this
setNode(Node $node)

No description

__construct(Node $node)

Create a new node handler with node to handle.

$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.

ArrayCollection
getNodesFromFieldName(string $fieldName)

Get nodes linked to current node for a given fieldname.

ArrayCollection
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()

Alias for NodeRepository::findAvailableTranslationForNode.

array
getAvailableTranslationsId()

Alias for NodeRepository::findAvailableTranslationIdForNode.

array
getUnavailableTranslations()

Alias for NodeRepository::findUnavailableTranslationForNode.

array
findUnavailableTranslationIdForNode()

Alias for NodeRepository::findUnavailableTranslationIdForNode.

bool
isRelatedToNewsletter()

Return if is in Newsletter Node.

bool
isRelatedToNode(Node $relative)

Return if part of Node offspring.

array
getParents(TokenStorageInterface $tokenStorage = null)

Return every node’s parents

int
cleanPositions()

Clean position for current node siblings.

int
cleanChildrenPositions()

Reset current node children positions.

static int
cleanRootNodesPositions()

Reset every root nodes positions.

array
getAllOffspringId()

Return all node offspring id.

$this
makeHome()

Set current node as the Home node.

duplicate()

Duplicate current node with all its children.

getPrevious(array $criteria = null, array $order = null, AuthorizationChecker $authorizationChecker = null, boolean $preview = false)

Get previous node from hierarchy.

getNext(array $criteria = null, array $order = null, AuthorizationChecker $authorizationChecker = null, boolean $preview = false)

Get next node from hierarchy.

Details

at line 53
Node getNode()

Return Value

Node

at line 63
$this setNode(Node $node)

Parameters

Node $node

Return Value

$this

at line 75
__construct(Node $node)

Create a new node handler with node to handle.

Parameters

Node $node

at line 87
$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

at line 113
$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

at line 141
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

at line 156
$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

at line 182
$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

at line 210
ArrayCollection getNodesFromFieldName(string $fieldName)

Get nodes linked to current node for a given fieldname.

Parameters

string $fieldName Name of the node-type field

Return Value

ArrayCollection Collection of nodes

at line 228
ArrayCollection 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

ArrayCollection Collection of nodes

at line 247
NodesSources getNodeSourceByTranslation(Translation $translation)

Get node source by translation.

Parameters

Translation $translation

Return Value

NodesSources

at line 272
$this removeAssociations()

Remove only current node associations.

Return Value

$this

at line 288
$this removeWithChildrenAndAssociations()

Remove current node with its children recursively and its associations.

This method DOES NOT flush entityManager

Return Value

$this

at line 305
$this softRemoveWithChildren()

Soft delete node and its children.

This method does not flush!

Return Value

$this

at line 323
$this softUnremoveWithChildren()

Un-delete node and its children.

This method does not flush!

Return Value

$this

at line 341
$this publishWithChildren()

Publish node and its children.

This method does not flush!

Return Value

$this

at line 364
$this archiveWithChildren()

Archive node and its children.

This method does not flush!

Return Value

$this

at line 380
Translation[] getAvailableTranslations()

Alias for NodeRepository::findAvailableTranslationForNode.

Return Value

Translation[]

at line 390
array getAvailableTranslationsId()

Alias for NodeRepository::findAvailableTranslationIdForNode.

Return Value

array Array of Translation id

at line 401
array getUnavailableTranslations()

Alias for NodeRepository::findUnavailableTranslationForNode.

Return Value

array

at line 412
array findUnavailableTranslationIdForNode()

Alias for NodeRepository::findUnavailableTranslationIdForNode.

Return Value

array Array of Translation id

at line 423
bool isRelatedToNewsletter()

Return if is in Newsletter Node.

Return Value

bool

at line 445
bool isRelatedToNode(Node $relative)

Return if part of Node offspring.

Parameters

Node $relative

Return Value

bool

at line 466
array getParents(TokenStorageInterface $tokenStorage = null)

Return every node’s parents

Parameters

TokenStorageInterface $tokenStorage

Return Value

array

at line 495
int cleanPositions()

Clean position for current node siblings.

Warning, this method does not flush.

Return Value

int Return the next position after the last node

at line 511
int cleanChildrenPositions()

Reset current node children positions.

Warning, this method does not flush.

Return Value

int Return the next position after the last node

at line 530
static int cleanRootNodesPositions()

Reset every root nodes positions.

Warning, this method does not flush.

Return Value

int Return the next position after the last node

at line 550
array getAllOffspringId()

Return all node offspring id.

Return Value

array

at line 561
$this makeHome()

Set current node as the Home node.

Return Value

$this

at line 583
Node duplicate()

Duplicate current node with all its children.

Return Value

Node

at line 599
Node getPrevious(array $criteria = null, array $order = null, AuthorizationChecker $authorizationChecker = null, boolean $preview = false)

Get previous node from hierarchy.

Parameters

array $criteria
array $order
AuthorizationChecker $authorizationChecker
boolean $preview

Return Value

Node

at line 648
Node getNext(array $criteria = null, array $order = null, AuthorizationChecker $authorizationChecker = null, boolean $preview = false)

Get next node from hierarchy.

Parameters

array $criteria
array $order
AuthorizationChecker $authorizationChecker
boolean $preview

Return Value

Node