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