class UniqueNodeGenerator (View source)

Class UniqueNodeGenerator

Properties

protected $entityManager

Methods

__construct(EntityManager $entityManager)

UniqueNodeGenerator constructor.

generate(NodeType $nodeType, Translation $translation, Node $parent = null, Tag $tag = null, boolean $pushToTop = false)

Generate a node with a unique name.

generateFromRequest(Request $request)

Try to generate a unique node from request variables.

Details

__construct(EntityManager $entityManager)

UniqueNodeGenerator constructor.

Parameters

EntityManager $entityManager

NodesSources generate(NodeType $nodeType, Translation $translation, Node $parent = null, Tag $tag = null, boolean $pushToTop = false)

Generate a node with a unique name.

This method flush entity-manager.

Parameters

NodeType $nodeType
Translation $translation
Node $parent
Tag $tag
boolean $pushToTop

Return Value

NodesSources

NodesSources generateFromRequest(Request $request)

Try to generate a unique node from request variables.

Parameters

Request $request

Return Value

NodesSources