PHP Class Neos\ContentRepository\Domain\Factory\NodeFactory

Exibir arquivo Open project: neos/neos-development-collection Class Usage Examples

Protected Properties

Property Type Description
$contextFactory Neos\ContentRepository\Domain\Service\ContextFactoryInterface
$nodes array<\Neos\ContentRepository\Domain\Model\Node>
$objectManager Neos\Flow\ObjectManagement\ObjectManagerInterface
$securityContext Neos\Flow\Security\Context

Public Methods

Method Description
createContextMatchingNodeData ( NodeData $nodeData ) : Context Generates a Context that exactly fits the given NodeData Workspace and Dimensions.
createFromNodeData ( NodeData $nodeData, Context $context ) : Neos\ContentRepository\Domain\Model\NodeInterface Creates a node from the given NodeData container.
getNodeInterfaceImplementations ( Neos\Flow\ObjectManagement\ObjectManagerInterface $objectManager ) : array Get all NodeInterface implementations to check if a configured node class is in there.
reset ( ) : void Reset the node instances (for testing)

Protected Methods

Method Description
filterNodeByContext ( Neos\ContentRepository\Domain\Model\NodeInterface $node, Context $context ) : Neos\ContentRepository\Domain\Model\NodeInterface | null Filter a node by the current context.

Method Details

createContextMatchingNodeData() public method

TODO: We could get more specific about removed and invisible content by adding some more logic here that generates fitting values.
public createContextMatchingNodeData ( NodeData $nodeData ) : Context
$nodeData Neos\ContentRepository\Domain\Model\NodeData
return Neos\ContentRepository\Domain\Service\Context

createFromNodeData() public method

If this factory has previously created a Node for the given $node and it's dimensions, it will return the same node again.
public createFromNodeData ( NodeData $nodeData, Context $context ) : Neos\ContentRepository\Domain\Model\NodeInterface
$nodeData Neos\ContentRepository\Domain\Model\NodeData
$context Neos\ContentRepository\Domain\Service\Context
return Neos\ContentRepository\Domain\Model\NodeInterface

filterNodeByContext() protected method

Will either return the node or NULL if it is not permitted in current context.
protected filterNodeByContext ( Neos\ContentRepository\Domain\Model\NodeInterface $node, Context $context ) : Neos\ContentRepository\Domain\Model\NodeInterface | null
$node Neos\ContentRepository\Domain\Model\NodeInterface
$context Neos\ContentRepository\Domain\Service\Context
return Neos\ContentRepository\Domain\Model\NodeInterface | null

getNodeInterfaceImplementations() public static method

Get all NodeInterface implementations to check if a configured node class is in there.
public static getNodeInterfaceImplementations ( Neos\Flow\ObjectManagement\ObjectManagerInterface $objectManager ) : array
$objectManager Neos\Flow\ObjectManagement\ObjectManagerInterface
return array

reset() public method

Reset the node instances (for testing)
public reset ( ) : void
return void

Property Details

$contextFactory protected_oe property

protected ContextFactoryInterface,Neos\ContentRepository\Domain\Service $contextFactory
return Neos\ContentRepository\Domain\Service\ContextFactoryInterface

$nodes protected_oe property

protected array<\Neos\ContentRepository\Domain\Model\Node> $nodes
return array<\Neos\ContentRepository\Domain\Model\Node>

$objectManager protected_oe property

protected ObjectManagerInterface,Neos\Flow\ObjectManagement $objectManager
return Neos\Flow\ObjectManagement\ObjectManagerInterface

$securityContext protected_oe property

protected Context,Neos\Flow\Security $securityContext
return Neos\Flow\Security\Context