PHP 클래스 Neos\ContentRepository\Domain\Service\Context

파일 보기 프로젝트 열기: neos/neos-development-collection 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$contextFactory Neos\ContentRepository\Domain\Service\ContextFactoryInterface
$currentDateTime DateTime
$dimensions array
$firstLevelNodeCache Neos\ContentRepository\Domain\Service\Cache\FirstLevelNodeCache
$inaccessibleContentShown boolean If TRUE, even content elements will be shown which are not accessible by the currently logged in account.
$invisibleContentShown boolean If TRUE, invisible content elements will be shown.
$nodeDataRepository Neos\ContentRepository\Domain\Repository\NodeDataRepository
$nodeFactory Neos\ContentRepository\Domain\Factory\NodeFactory
$removedContentShown boolean If TRUE, removed content elements will be shown, even though they are removed.
$systemLogger Neos\Flow\Log\SystemLoggerInterface
$targetDimensions array
$workspace Neos\ContentRepository\Domain\Model\Workspace
$workspaceName string
$workspaceRepository Neos\ContentRepository\Domain\Repository\WorkspaceRepository

공개 메소드들

메소드 설명
__construct ( string $workspaceName, DateTimeInterface $currentDateTime, array $dimensions, array $targetDimensions, boolean $invisibleContentShown, boolean $removedContentShown, boolean $inaccessibleContentShown ) Creates a new Context object.
adoptNode ( Neos\ContentRepository\Domain\Model\NodeInterface $node, boolean $recursive = false ) : Neos\ContentRepository\Domain\Model\NodeInterface Adopts a node from a (possibly) different context to this context
getCurrentDateTime ( ) : DateTime Returns the current date and time in form of a \DateTime object.
getDimensions ( ) : array An indexed array of dimensions with ordered list of values for matching nodes by content dimensions
getFirstLevelNodeCache ( ) : FirstLevelNodeCache Not public API!
getNode ( string $path ) : Neos\ContentRepository\Domain\Model\NodeInterface Returns a node specified by the given absolute path.
getNodeByIdentifier ( string $identifier ) : Neos\ContentRepository\Domain\Model\NodeInterface Get a node by identifier and this context
getNodeVariantsByIdentifier ( string $identifier ) : array<\Neos\ContentRepository\Domain\Model\NodeInterface> Get all node variants for the given identifier
getNodesOnPath ( mixed $startingPoint, mixed $endPoint ) : array<\Neos\ContentRepository\Domain\Model\NodeInterface> Finds all nodes lying on the path specified by (and including) the given starting point and end point.
getProperties ( ) : array Returns the properties of this context.
getRootNode ( ) : Neos\ContentRepository\Domain\Model\NodeInterface Convenience method returns the root node for this context workspace.
getTargetDimensionValues ( ) : array An indexed array of dimensions with a set of values that should be applied when updating or creating
getTargetDimensions ( ) : array An indexed array of dimensions with a set of values that should be applied when updating or creating
getWorkspace ( boolean $createWorkspaceIfNecessary = true ) : Workspace Returns the current workspace.
getWorkspaceName ( ) : string Returns the name of the workspace.
isInaccessibleContentShown ( ) : boolean Tells if nodes which have access restrictions should be accessible through the Node API and queries even without the necessary roles / rights
isInvisibleContentShown ( ) : boolean Tells if nodes which are usually invisible should be accessible through the Node API and queries
isRemovedContentShown ( ) : boolean Tells if nodes which have their "removed" flag set should be accessible through the Node API and queries
validateWorkspace ( Workspace $workspace ) : void This method is called in order to check if a workspace is accessible.

보호된 메소드들

메소드 설명
emitAfterAdoptNode ( Neos\ContentRepository\Domain\Model\NodeInterface $node, Context $context, $recursive )
emitBeforeAdoptNode ( Neos\ContentRepository\Domain\Model\NodeInterface $node, Context $context, $recursive )

메소드 상세

__construct() 공개 메소드

NOTE: This is for internal use only, you should use the ContextFactory for creating Context instances.
또한 보기: ContextFactoryInterface
public __construct ( string $workspaceName, DateTimeInterface $currentDateTime, array $dimensions, array $targetDimensions, boolean $invisibleContentShown, boolean $removedContentShown, boolean $inaccessibleContentShown )
$workspaceName string Name of the current workspace
$currentDateTime DateTimeInterface The current date and time
$dimensions array Array of dimensions with array of ordered values
$targetDimensions array Array of dimensions used when creating / modifying content
$invisibleContentShown boolean If invisible content should be returned in query results
$removedContentShown boolean If removed content should be returned in query results
$inaccessibleContentShown boolean If inaccessible content should be returned in query results

adoptNode() 공개 메소드

Checks if a node variant matching the exact dimensions already exists for this context and return it if found. Otherwise a new node variant for this context is created. In case the node already exists in the context but does not match the target dimensions a new, more specific node is created and returned.
public adoptNode ( Neos\ContentRepository\Domain\Model\NodeInterface $node, boolean $recursive = false ) : Neos\ContentRepository\Domain\Model\NodeInterface
$node Neos\ContentRepository\Domain\Model\NodeInterface The node with a different context. If the context of the given node is the same as this context the operation will have no effect.
$recursive boolean If TRUE also adopt all descendant nodes which are non-aggregate
리턴 Neos\ContentRepository\Domain\Model\NodeInterface A new or existing node that matches this context

emitAfterAdoptNode() 보호된 메소드

protected emitAfterAdoptNode ( Neos\ContentRepository\Domain\Model\NodeInterface $node, Context $context, $recursive )
$node Neos\ContentRepository\Domain\Model\NodeInterface
$context Context
$recursive

emitBeforeAdoptNode() 보호된 메소드

protected emitBeforeAdoptNode ( Neos\ContentRepository\Domain\Model\NodeInterface $node, Context $context, $recursive )
$node Neos\ContentRepository\Domain\Model\NodeInterface
$context Context
$recursive

getCurrentDateTime() 공개 메소드

If you use this method for getting the current date and time everywhere in your code, it will be possible to simulate a certain time in unit tests or in the actual application (for realizing previews etc).
public getCurrentDateTime ( ) : DateTime
리턴 DateTime The current date and time - or a simulated version of it

getDimensions() 공개 메소드

An indexed array of dimensions with ordered list of values for matching nodes by content dimensions
public getDimensions ( ) : array
리턴 array

getFirstLevelNodeCache() 공개 메소드

Not public API!
public getFirstLevelNodeCache ( ) : FirstLevelNodeCache
리턴 Neos\ContentRepository\Domain\Service\Cache\FirstLevelNodeCache

getNode() 공개 메소드

Returns a node specified by the given absolute path.
public getNode ( string $path ) : Neos\ContentRepository\Domain\Model\NodeInterface
$path string Absolute path specifying the node
리턴 Neos\ContentRepository\Domain\Model\NodeInterface The specified node or NULL if no such node exists

getNodeByIdentifier() 공개 메소드

Get a node by identifier and this context
public getNodeByIdentifier ( string $identifier ) : Neos\ContentRepository\Domain\Model\NodeInterface
$identifier string The identifier of a node
리턴 Neos\ContentRepository\Domain\Model\NodeInterface The node with the given identifier or NULL if no such node exists

getNodeVariantsByIdentifier() 공개 메소드

A variant of a node can have different dimension values and path (for non-aggregate nodes). The resulting node instances might belong to a different context.
public getNodeVariantsByIdentifier ( string $identifier ) : array<\Neos\ContentRepository\Domain\Model\NodeInterface>
$identifier string The identifier of a node
리턴 array<\Neos\ContentRepository\Domain\Model\NodeInterface>

getNodesOnPath() 공개 메소드

Finds all nodes lying on the path specified by (and including) the given starting point and end point.
public getNodesOnPath ( mixed $startingPoint, mixed $endPoint ) : array<\Neos\ContentRepository\Domain\Model\NodeInterface>
$startingPoint mixed Either an absolute path or an actual node specifying the starting point, for example /sites/mysitecom
$endPoint mixed Either an absolute path or an actual node specifying the end point, for example /sites/mysitecom/homepage/subpage
리턴 array<\Neos\ContentRepository\Domain\Model\NodeInterface>

getProperties() 공개 메소드

Returns the properties of this context.
public getProperties ( ) : array
리턴 array

getRootNode() 공개 메소드

Convenience method returns the root node for this context workspace.
public getRootNode ( ) : Neos\ContentRepository\Domain\Model\NodeInterface
리턴 Neos\ContentRepository\Domain\Model\NodeInterface

getTargetDimensionValues() 공개 메소드

An indexed array of dimensions with a set of values that should be applied when updating or creating
public getTargetDimensionValues ( ) : array
리턴 array

getTargetDimensions() 공개 메소드

An indexed array of dimensions with a set of values that should be applied when updating or creating
public getTargetDimensions ( ) : array
리턴 array

getWorkspace() 공개 메소드

Returns the current workspace.
public getWorkspace ( boolean $createWorkspaceIfNecessary = true ) : Workspace
$createWorkspaceIfNecessary boolean DEPRECATED: If enabled, creates a workspace with the configured name if it doesn't exist already. This option is DEPRECATED, create workspace explicitly instead.
리턴 Neos\ContentRepository\Domain\Model\Workspace The workspace or NULL

getWorkspaceName() 공개 메소드

Returns the name of the workspace.
public getWorkspaceName ( ) : string
리턴 string

isInaccessibleContentShown() 공개 메소드

Tells if nodes which have access restrictions should be accessible through the Node API and queries even without the necessary roles / rights

isInvisibleContentShown() 공개 메소드

Tells if nodes which are usually invisible should be accessible through the Node API and queries

isRemovedContentShown() 공개 메소드

Tells if nodes which have their "removed" flag set should be accessible through the Node API and queries
public isRemovedContentShown ( ) : boolean
리턴 boolean

validateWorkspace() 공개 메소드

At the time of this writing, it is not possible in Flow to restrict access to Workspace through Entity Privileges because Workspaces are used at a very early stage during routing where the security context is not yet initialized. As a workaround, we use a Method Privilege which protects this validateWorkspace() method and thus prevents unauthorized access to a workspace when calling this context's getWorkspace() method. Since some privilege definitions check the "owner" property of a Workspace, we need a real Workspace object and not just the name - hence this method.
public validateWorkspace ( Workspace $workspace ) : void
$workspace Neos\ContentRepository\Domain\Model\Workspace The workspace to check
리턴 void

프로퍼티 상세

$contextFactory 보호되어 있는 프로퍼티

protected ContextFactoryInterface,Neos\ContentRepository\Domain\Service $contextFactory
리턴 Neos\ContentRepository\Domain\Service\ContextFactoryInterface

$currentDateTime 보호되어 있는 프로퍼티

protected DateTime $currentDateTime
리턴 DateTime

$dimensions 보호되어 있는 프로퍼티

protected array $dimensions
리턴 array

$firstLevelNodeCache 보호되어 있는 프로퍼티

protected FirstLevelNodeCache,Neos\ContentRepository\Domain\Service\Cache $firstLevelNodeCache
리턴 Neos\ContentRepository\Domain\Service\Cache\FirstLevelNodeCache

$inaccessibleContentShown 보호되어 있는 프로퍼티

If TRUE, even content elements will be shown which are not accessible by the currently logged in account.
protected bool $inaccessibleContentShown
리턴 boolean

$invisibleContentShown 보호되어 있는 프로퍼티

If TRUE, invisible content elements will be shown.
protected bool $invisibleContentShown
리턴 boolean

$nodeDataRepository 보호되어 있는 프로퍼티

protected NodeDataRepository,Neos\ContentRepository\Domain\Repository $nodeDataRepository
리턴 Neos\ContentRepository\Domain\Repository\NodeDataRepository

$nodeFactory 보호되어 있는 프로퍼티

protected NodeFactory,Neos\ContentRepository\Domain\Factory $nodeFactory
리턴 Neos\ContentRepository\Domain\Factory\NodeFactory

$removedContentShown 보호되어 있는 프로퍼티

If TRUE, removed content elements will be shown, even though they are removed.
protected bool $removedContentShown
리턴 boolean

$systemLogger 보호되어 있는 프로퍼티

protected SystemLoggerInterface,Neos\Flow\Log $systemLogger
리턴 Neos\Flow\Log\SystemLoggerInterface

$targetDimensions 보호되어 있는 프로퍼티

protected array $targetDimensions
리턴 array

$workspace 보호되어 있는 프로퍼티

protected Workspace,Neos\ContentRepository\Domain\Model $workspace
리턴 Neos\ContentRepository\Domain\Model\Workspace

$workspaceName 보호되어 있는 프로퍼티

protected string $workspaceName
리턴 string

$workspaceRepository 보호되어 있는 프로퍼티

protected WorkspaceRepository,Neos\ContentRepository\Domain\Repository $workspaceRepository
리턴 Neos\ContentRepository\Domain\Repository\WorkspaceRepository