class NodesSourcesHandler extends AbstractHandler (View source)

Handle operations with node-sources entities.

Properties

protected ObjectManager $objectManager from AbstractHandler
protected NodesSources $nodeSource
protected NodesSources[] $parentsNodeSources
protected AuthorizationChecker $authorizationChecker
protected bool $isPreview
protected Settings $settingsBag
protected TagApi $tagApi

Methods

ObjectManager
getObjectManager()

No description

setObjectManager(ObjectManager $objectManager)

No description

__construct(ObjectManager $objectManager, Settings $settingsBag, TagApi $tagApi)

AbstractHandler constructor.

int
cleanPositions(bool $setPositions = true)

Clean positions for current entity siblings.

getNodeSource()

No description

setNodeSource(NodesSources $nodeSource)

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

Get a string describing uniquely the current nodeSource.

getParent() deprecated

Get parent node-source to get the current translation.

array
getParents(array $criteria = null)

Get every nodeSources parents from direct parent to farest ancestor.

getChildren(array $criteria = null, array $order = null)

Get children nodes sources to lock with current translation.

getFirstChild(array $criteria = null, array $order = null)

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

getLastChild(array $criteria = null, array $order = null)

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

getFirstSibling(array $criteria = null, array $order = null)

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

getLastSibling(array $criteria = null, array $order = null)

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

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

Get previous node-source from hierarchy.

NodesSources|object|null
getNext(array $criteria = null, array $order = null)

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

ObjectManager getObjectManager()

Return Value

ObjectManager

AbstractHandler setObjectManager(ObjectManager $objectManager)

Parameters

ObjectManager $objectManager

Return Value

AbstractHandler

__construct(ObjectManager $objectManager, Settings $settingsBag, TagApi $tagApi)

AbstractHandler constructor.

Parameters

ObjectManager $objectManager
Settings $settingsBag
TagApi $tagApi

int cleanPositions(bool $setPositions = true)

Clean positions for current entity siblings.

Parameters

bool $setPositions

Return Value

int Return the next position after the last entity

NodesSources getNodeSource()

Return Value

NodesSources

NodesSourcesHandler setNodeSource(NodesSources $nodeSource)

Parameters

NodesSources $nodeSource

Return Value

NodesSourcesHandler

$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

$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

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[]

string getIdentifier() deprecated

deprecated Use directly NodesSources::getIdentifier

Get a string describing uniquely the current nodeSource.

Can be the urlAlias or the nodeName

Return Value

string

NodesSources getParent() deprecated

deprecated Use directly NodesSources::getParent

Get parent node-source to get the current translation.

Return Value

NodesSources

array getParents(array $criteria = null)

Get every nodeSources parents from direct parent to farest ancestor.

Parameters

array $criteria

Return Value

array

NodesSources[] getChildren(array $criteria = null, array $order = null)

Get children nodes sources to lock with current translation.

Parameters

array $criteria Additionnal criteria
array $order Non default ordering

Return Value

NodesSources[] collection

NodesSources|null getFirstChild(array $criteria = null, array $order = null)

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

Get non-newsletter nodes-sources by default.

Parameters

array $criteria
array $order

Return Value

NodesSources|null

NodesSources|null getLastChild(array $criteria = null, array $order = null)

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

Get non-newsletter nodes-sources by default.

Parameters

array $criteria
array $order

Return Value

NodesSources|null

NodesSources|null getFirstSibling(array $criteria = null, array $order = null)

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

Parameters

array $criteria
array $order

Return Value

NodesSources|null

NodesSources|null getLastSibling(array $criteria = null, array $order = null)

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

Get non-newsletter nodes-sources by default.

Parameters

array $criteria
array $order

Return Value

NodesSources|null

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

Get previous node-source from hierarchy.

Get non-newsletter nodes-sources by default.

Parameters

array $criteria
array $order

Return Value

NodesSources|null

NodesSources|object|null getNext(array $criteria = null, array $order = null)

Get next node-source from hierarchy.

Get non-newsletter nodes-sources by default.

Parameters

array $criteria
array $order

Return Value

NodesSources|object|null

array getTags()

Get node tags with current source translation.

Return Value

array

array getSEO()

Get current node-source SEO data.

This method returns a 3-fields array with:

  • title
  • description
  • keywords

Return Value

array

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

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