Beta version

class NodesSourcesHandler

Handle operations with node-sources entities.

Methods

__construct(NodesSources $nodeSource)

Create a new node-source handler with node-source to handle.

$this
setParentNodeSource(NodesSources $newparentNodeSource)

No description

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

Remove every node-source documents associations for a given field.

$this
addDocumentForField(Document $document, NodeTypeField $field, bool $flush = true, null|integer $position = null)

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

getDocumentsFromFieldName(string $fieldName)

Get documents linked to current node-source for a given fieldname.

string
getIdentifier()

Get a string describing uniquely the curent nodeSource.

getParent()

Get parent node-source to get the current translation.

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

Get every nodeSources parents from direct parent to farest ancestor.

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

Get children nodes sources to lock with current translation.

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

Get first node-source among current node-source children.

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

Get last node-source among current node-source children.

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

Get first node-source in the same parent as current node-source.

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

Get last node-source in the same parent as current node-source.

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

Get previous node-source from hierarchy.

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

Get next node-source from hierarchy.

array
getTags()

Get node tags with current source translation.

array
getSEO()

Get current node-source SEO data.

array
getNodesFromFieldName(string $fieldName)

Get nodes linked to current node for a given fieldname.

array
getReverseNodesFromFieldName(string $fieldName)

Get nodes which own a reference to current node for a given fieldname.

Details

at line 56
__construct(NodesSources $nodeSource)

Create a new node-source handler with node-source to handle.

Parameters

NodesSources $nodeSource

at line 64
NodesSources getParentNodeSource()

Return Value

NodesSources

at line 73
$this setParentNodeSource(NodesSources $newparentNodeSource)

Parameters

NodesSources $newparentNodeSource

Return Value

$this

at line 87
$this cleanDocumentsFromField(NodeTypeField $field, bool $flush = true)

Remove every node-source documents associations for a given field.

Parameters

NodeTypeField $field
bool $flush

Return Value

$this

at line 115
$this addDocumentForField(Document $document, NodeTypeField $field, bool $flush = true, null|integer $position = null)

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

Parameters

Document $document
NodeTypeField $field
bool $flush
null|integer $position

Return Value

$this

at line 143
Document[] getDocumentsFromFieldName(string $fieldName)

Get documents linked to current node-source for a given fieldname.

Parameters

string $fieldName Name of the node-type field

Return Value

Document[]

at line 157
string getIdentifier()

Get a string describing uniquely the curent nodeSource.

Can be the urlAlias or the nodeName

Return Value

string

at line 175
NodesSources getParent()

Get parent node-source to get the current translation.

Return Value

NodesSources

at line 195
array getParents(array $criteria = null, AuthorizationChecker $authorizationChecker = null, boolean $preview = false)

Get every nodeSources parents from direct parent to farest ancestor.

Parameters

array $criteria
AuthorizationChecker $authorizationChecker
boolean $preview

Return Value

array

at line 247
ArrayCollection getChildren(array $criteria = null, array $order = null, AuthorizationChecker $authorizationChecker = null, boolean $preview = false)

Get children nodes sources to lock with current translation.

Parameters

array $criteria Additionnal criteria
array $order Non default ordering
AuthorizationChecker $authorizationChecker
boolean $preview

Return Value

ArrayCollection NodesSources collection

at line 300
NodesSources getFirstChild(array $criteria = null, array $order = null, AuthorizationChecker $authorizationChecker = null, boolean $preview = false)

Get first node-source among current node-source children.

Get non-newsletter nodes-sources by default.

Parameters

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

Return Value

NodesSources

at line 350
NodesSources getLastChild(array $criteria = null, array $order = null, AuthorizationChecker $authorizationChecker = null, boolean $preview = false)

Get last node-source among current node-source children.

Get non-newsletter nodes-sources by default.

Parameters

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

Return Value

NodesSources

at line 399
NodesSources getFirstSibling(array $criteria = null, array $order = null, AuthorizationChecker $authorizationChecker = null, boolean $preview = false)

Get first node-source in the same parent as current node-source.

Parameters

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

Return Value

NodesSources

at line 425
NodesSources getLastSibling(array $criteria = null, array $order = null, AuthorizationChecker $authorizationChecker = null, boolean $preview = false)

Get last node-source in the same parent as current node-source.

Get non-newsletter nodes-sources by default.

Parameters

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

Return Value

NodesSources

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

Get previous node-source from hierarchy.

Get non-newsletter nodes-sources by default.

Parameters

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

Return Value

NodesSources

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

Get next node-source from hierarchy.

Get non-newsletter nodes-sources by default.

Parameters

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

Return Value

NodesSources

at line 556
array getTags()

Get node tags with current source translation.

Return Value

array

at line 577
array getSEO()

Get current node-source SEO data.

This method returns a 3-fields array with:

  • title
  • description
  • keywords

Return Value

array

at line 597
array getNodesFromFieldName(string $fieldName)

Get nodes linked to current node for a given fieldname.

Parameters

string $fieldName Name of the node-type field

Return Value

array Collection of nodes

at line 617
array getReverseNodesFromFieldName(string $fieldName)

Get nodes which own a reference to current node for a given fieldname.

Parameters

string $fieldName Name of the node-type field

Return Value

array Collection of nodes