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.

ArrayCollection
getNodesFromFieldName(string $fieldName)

Get nodes linked to current node for a given fieldname.

ArrayCollection
getReverseNodesFromFieldName(string $fieldName)

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

Details

at line 57
__construct(NodesSources $nodeSource)

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

Parameters

NodesSources $nodeSource

at line 65
NodesSources getParentNodeSource()

Return Value

NodesSources

at line 74
$this setParentNodeSource(NodesSources $newparentNodeSource)

Parameters

NodesSources $newparentNodeSource

Return Value

$this

at line 88
$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 116
$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 144
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 158
string getIdentifier()

Get a string describing uniquely the curent nodeSource.

Can be the urlAlias or the nodeName

Return Value

string

at line 176
NodesSources getParent()

Get parent node-source to get the current translation.

Return Value

NodesSources

at line 196
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 248
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 301
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 351
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 400
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 426
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 452
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 511
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 557
array getTags()

Get node tags with current source translation.

Return Value

array

at line 578
array getSEO()

Get current node-source SEO data.

This method returns a 3-fields array with:

  • title
  • description
  • keywords

Return Value

array

at line 598
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 618
ArrayCollection 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

ArrayCollection Collection of nodes