PHP Класс Jackalope\NodeType\NodeTypeManager

In Jackalope, we try to do lazy fetching of node types to reduce overhead. Jackalope supports registering node types, and when using the jackrabbit for transport, there is an additional method registerNodeTypesCnd for the jackrabbit specific textual node type specification
Наследование: implements IteratorAggregat\IteratorAggregate, implements PHPCR\NodeType\NodeTypeManagerInterface
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$factory Jackalope\FactoryInterface The factory to instantiate objects.
$fetchedAllFromBackend boolean Methods like hasNodeType() need to fetch all node types. Others like getNodeType() do not need all, but just the requested one. Unless we need all, we only load specific ones and cache them.
$mixinTypes array Cache of already fetched mixin node type instances.
$namespaceRegistry PHPCR\NamespaceRegistryInterface
$nodeTree array Array of arrays with the super type as key and its sub types as values.
$objectManager Jackalope\ObjectManager
$primaryTypes array Cache of already fetched primary node type instances.

Открытые методы

Метод Описание
__construct ( Jackalope\FactoryInterface $factory, ObjectManager $objectManager, PHPCR\NamespaceRegistryInterface $namespaceRegistry ) Create the node type manager for a session.
createNodeDefinitionTemplate ( ) {@inheritDoc}
createNodeTypeTemplate ( $ntd = null ) {@inheritDoc}
createPropertyDefinitionTemplate ( ) {@inheritDoc}
getAllNodeTypes ( ) {@inheritDoc}
getDeclaredSubtypes ( string $nodeTypeName ) : array Helper method for node types: Returns the declared subtypes of a given nodename.
getIterator ( ) : Iterator Provide Traversable interface: redirect to getAllNodeTypes
getMixinNodeTypes ( ) {@inheritDoc}
getNodeType ( $nodeTypeName ) {@inheritDoc}
getPrimaryNodeTypes ( ) {@inheritDoc}
getSubtypes ( string $nodeTypeName ) : array Helper method for NodeType: Returns all sub types of a node and their sub types.
hasNodeType ( $name ) {@inheritDoc}
registerNodeType ( PHPCR\NodeType\NodeTypeDefinitionInterface $ntd, $allowUpdate ) {@inheritDoc}
registerNodeTypes ( array $definitions, $allowUpdate ) {@inheritDoc}
registerNodeTypesCnd ( $cnd, $allowUpdate ) {@inheritDoc}
unregisterNodeType ( $name ) {@inheritDoc}
unregisterNodeTypes ( array $names ) {@inheritDoc}

Защищенные методы

Метод Описание
addNodeType ( PHPCR\NodeType\NodeTypeInterface $nodeType ) Stores the node type in our internal structures (flat && tree)
createNodeType ( PHPCR\NodeType\NodeTypeDefinitionInterface $ntd, boolean $allowUpdate ) : NodeType Internally create a node type object
fetchNodeTypes ( string $name = null ) Fetch a node type from backend.

Приватные методы

Метод Описание
addToNodeTree ( PHPCR\NodeType\NodeTypeInterface $nodetype ) Adds the declared super types of a node type to the tree to be able to fetch the sub types of those super types later on.

Описание методов

__construct() публичный Метод

There may be only one instance per session
public __construct ( Jackalope\FactoryInterface $factory, ObjectManager $objectManager, PHPCR\NamespaceRegistryInterface $namespaceRegistry )
$factory Jackalope\FactoryInterface
$objectManager Jackalope\ObjectManager
$namespaceRegistry PHPCR\NamespaceRegistryInterface

addNodeType() защищенный Метод

Stores the node type in our internal structures (flat && tree)
protected addNodeType ( PHPCR\NodeType\NodeTypeInterface $nodeType )
$nodeType PHPCR\NodeType\NodeTypeInterface The nodetype to add

createNodeDefinitionTemplate() публичный Метод

{@inheritDoc}

createNodeType() защищенный Метод

Internally create a node type object
protected createNodeType ( PHPCR\NodeType\NodeTypeDefinitionInterface $ntd, boolean $allowUpdate ) : NodeType
$ntd PHPCR\NodeType\NodeTypeDefinitionInterface
$allowUpdate boolean whether updating the definition is to be allowed or not
Результат NodeType the new node type

createNodeTypeTemplate() публичный Метод

{@inheritDoc}
public createNodeTypeTemplate ( $ntd = null )

createPropertyDefinitionTemplate() публичный Метод

{@inheritDoc}

fetchNodeTypes() защищенный Метод

Without a filter parameter, this will fetch all node types from the backend. It is no problem to call this method with null as name, it will remember once it fetched all node types and do nothing after that. On fetch all, already cached node types are kept.
protected fetchNodeTypes ( string $name = null )
$name string type name to fetch. defaults to null which will fetch all nodes.

getAllNodeTypes() публичный Метод

{@inheritDoc}
public getAllNodeTypes ( )

getDeclaredSubtypes() публичный Метод

Helper method for node types: Returns the declared subtypes of a given nodename.
См. также: NodeType::getDeclaredSubtypes
public getDeclaredSubtypes ( string $nodeTypeName ) : array
$nodeTypeName string
Результат array with the names of the subnode types pointing to the node type instances

getIterator() публичный Метод

Provide Traversable interface: redirect to getAllNodeTypes
public getIterator ( ) : Iterator
Результат Iterator over all node types

getMixinNodeTypes() публичный Метод

{@inheritDoc}
public getMixinNodeTypes ( )

getNodeType() публичный Метод

{@inheritDoc}
public getNodeType ( $nodeTypeName )

getPrimaryNodeTypes() публичный Метод

{@inheritDoc}
public getPrimaryNodeTypes ( )

getSubtypes() публичный Метод

Helper method for NodeType: Returns all sub types of a node and their sub types.
См. также: NodeType::getSubtypes
public getSubtypes ( string $nodeTypeName ) : array
$nodeTypeName string
Результат array with the names of the subnode types pointing to the node type instances

hasNodeType() публичный Метод

{@inheritDoc}
public hasNodeType ( $name )

registerNodeType() публичный Метод

{@inheritDoc}
public registerNodeType ( PHPCR\NodeType\NodeTypeDefinitionInterface $ntd, $allowUpdate )
$ntd PHPCR\NodeType\NodeTypeDefinitionInterface

registerNodeTypes() публичный Метод

{@inheritDoc}
public registerNodeTypes ( array $definitions, $allowUpdate )
$definitions array

registerNodeTypesCnd() публичный Метод

{@inheritDoc}
public registerNodeTypesCnd ( $cnd, $allowUpdate )

unregisterNodeType() публичный Метод

{@inheritDoc}
public unregisterNodeType ( $name )

unregisterNodeTypes() публичный Метод

{@inheritDoc}
public unregisterNodeTypes ( array $names )
$names array

Описание свойств

$factory защищенное свойство

The factory to instantiate objects.
protected FactoryInterface,Jackalope $factory
Результат Jackalope\FactoryInterface

$fetchedAllFromBackend защищенное свойство

Methods like hasNodeType() need to fetch all node types. Others like getNodeType() do not need all, but just the requested one. Unless we need all, we only load specific ones and cache them.
protected bool $fetchedAllFromBackend
Результат boolean

$mixinTypes защищенное свойство

Cache of already fetched mixin node type instances.
protected array $mixinTypes
Результат array

$namespaceRegistry защищенное свойство

protected NamespaceRegistryInterface,PHPCR $namespaceRegistry
Результат PHPCR\NamespaceRegistryInterface

$nodeTree защищенное свойство

Array of arrays with the super type as key and its sub types as values.
protected array $nodeTree
Результат array

$objectManager защищенное свойство

protected ObjectManager,Jackalope $objectManager
Результат Jackalope\ObjectManager

$primaryTypes защищенное свойство

Cache of already fetched primary node type instances.
protected array $primaryTypes
Результат array