class NodeTypeHandler extends AbstractHandler (View source)

Handle operations with node-type entities.

Properties

protected ObjectManager $objectManager from AbstractHandler

Methods

ObjectManager
getObjectManager()

No description

setObjectManager(ObjectManager $objectManager)

No description

__construct(ObjectManager $objectManager, Container $container, Kernel $kernel)

AbstractHandler constructor.

int
cleanPositions(bool $setPosition = false)

Clean positions for current entity siblings.

getNodeType()

No description

$this
setNodeType(NodeType $nodeType)

No description

string
getGeneratedEntitiesFolder()

No description

boolean
removeSourceEntityClass()

Remove node type entity class file from server.

string
generateSourceEntityClass()

Generate Doctrine entity class for current nodetype.

$this
updateSchema()

Clear doctrine metadata cache and regenerate entity class file.

regenerateEntityClass()

Delete and recreate entity class file.

$this
deleteSchema()

Delete node-type class from database.

clearCaches()

No description

$this
deleteWithAssociations()

Delete node-type inherited nodes and its database schema before removing it from node-types table.

diff(NodeType $newNodeType)

Update current node-type using a new one.

Details

ObjectManager getObjectManager()

Return Value

ObjectManager

AbstractHandler setObjectManager(ObjectManager $objectManager)

Parameters

ObjectManager $objectManager

Return Value

AbstractHandler

__construct(ObjectManager $objectManager, Container $container, Kernel $kernel)

AbstractHandler constructor.

Parameters

ObjectManager $objectManager
Container $container
Kernel $kernel

int cleanPositions(bool $setPosition = false)

Clean positions for current entity siblings.

Parameters

bool $setPosition

Return Value

int Return the next position after the last entity

NodeType getNodeType()

Return Value

NodeType

$this setNodeType(NodeType $nodeType)

Parameters

NodeType $nodeType

Return Value

$this

string getGeneratedEntitiesFolder()

Return Value

string

boolean removeSourceEntityClass()

Remove node type entity class file from server.

Return Value

boolean

string generateSourceEntityClass()

Generate Doctrine entity class for current nodetype.

Return Value

string or false

$this updateSchema()

Clear doctrine metadata cache and regenerate entity class file.

Return Value

$this

regenerateEntityClass()

Delete and recreate entity class file.

$this deleteSchema()

Delete node-type class from database.

Return Value

$this

protected clearCaches()

$this deleteWithAssociations()

Delete node-type inherited nodes and its database schema before removing it from node-types table.

Return Value

$this

diff(NodeType $newNodeType)

Update current node-type using a new one.

Update diff will update only non-critical fields such as :

  • description
  • displayName

It will only create absent node-type fields won't delete fields not to lose any data.

This method does not flush ORM. You'll need to manually call it.

Parameters

NodeType $newNodeType

Exceptions

RuntimeException If newNodeType param is null