final class VisibilityConstraints implements JsonSerializable (View source)

The visibility constraints define how nodes in the content subgraph are accessed.

For this the constraints need to be provided to {\Neos\ContentRepository\Core\Projection\ContentGraph\ContentGraphInterface::getSubgraph()}. Alternatively {\Neos\ContentRepository\Core\ContentRepository::getContentSubgraph()} uses the implemented {\Neos\ContentRepository\Core\Feature\Security\AuthProviderInterface} to determine the visibility constraint the current applications state via {[\Neos\ContentRepository\Core\Feature\Security\AuthProviderInterface::getVisibilityConstraints()}

To](../../../../../Neos/ContentRepository/Core/Feature/Security/AuthProviderInterface.html) have nodes for example with the tag my-disabled excluded use:

VisibilityConstraints::excludeSubtreeTags(SubtreeTags::create(
    SubtreeTag::fromString("my-disabled")
));

But to access them no constraints can be used includes those:

VisibilityConstraints::createEmpty();

Methods

createEmpty()

A subgraph without constraints for finding all nodes without filtering

excludeSubtreeTags(SubtreeTags $subtreeTags)

No description

string
getHash()

No description

array
jsonSerialize()

No description

fromTagConstraints(SubtreeTags $tagConstraints) deprecated

Please use {VisibilityConstraints::excludeSubtreeTags} instead.

default() deprecated

Legacy, only for Neos.Neos context!, for standalone use please use {self::excludeSubtreeTags()}

withoutRestrictions() deprecated

Legacy, only for Neos.Neos context!, for standalone use please use {self::createEmpty()}

Details

static VisibilityConstraints createEmpty()

A subgraph without constraints for finding all nodes without filtering

Return Value

VisibilityConstraints

static VisibilityConstraints excludeSubtreeTags(SubtreeTags $subtreeTags)

No description

Parameters

SubtreeTags $subtreeTags

A set of {\Neos\ContentRepository\Core\Feature\SubtreeTagging\Dto\SubtreeTag} instances that will be excluded from the results of any content graph query

Return Value

VisibilityConstraints

string getHash()

No description

Return Value

string

VisibilityConstraints merge(VisibilityConstraints $other)

No description

Parameters

VisibilityConstraints $other

Return Value

VisibilityConstraints

array jsonSerialize()

No description

Return Value

array

static VisibilityConstraints fromTagConstraints(SubtreeTags $tagConstraints) deprecated

deprecated with Neos 9 beta 19. To be removed with Neos 10.

Please use {VisibilityConstraints::excludeSubtreeTags} instead.

Parameters

SubtreeTags $tagConstraints

Return Value

VisibilityConstraints

static VisibilityConstraints default() deprecated

deprecated with Neos 9 beta 19. To be removed with Neos 10.

Legacy, only for Neos.Neos context!, for standalone use please use {self::excludeSubtreeTags()}

Please look into {\Neos\Neos\Domain\SubtreeTagging\NeosVisibilityConstraints} instead.

Return Value

VisibilityConstraints

static VisibilityConstraints withoutRestrictions() deprecated

deprecated with Neos 9 beta 19. To be removed with Neos 10.

Legacy, only for Neos.Neos context!, for standalone use please use {self::createEmpty()}

A subgraph without constraints for finding all nodes without filtering

Nodes for example with tag disabled will be findable but not soft removed nodes

For backwards compatibility to previous betas this method does not do what it promises. The classic Neos backend use-case previously used this method to be able to find also disabled nodes. Now with the introduction of soft removed tags, empty constraints will cause nodes to show up that were previously non-existent. Thus, this factory restricts 'removed' after all.

Please use {\Neos\Neos\Domain\SubtreeTagging\NeosVisibilityConstraints::excludeRemoved()} instead.

Return Value

VisibilityConstraints