class AssetUsageInNodePropertiesStrategy extends AbstractAssetUsageStrategy (View source)

Traits

A trait to add create a content context

Properties

protected ContentContextFactory $_contextFactory from  CreateContentContextTrait
protected SiteRepository $_siteRepository from  CreateContentContextTrait
protected NodeDataRepository $nodeDataRepository
protected array $firstlevelCache
protected PersistenceManagerInterface $persistenceManager

Methods

bool
isInUse(AssetInterface $asset)

Returns true if the asset is used.

int
getUsageCount(AssetInterface $asset)

Returns the total count of usages found.

createContentContext(string $workspaceName, array $dimensions = [])

Create a ContentContext based on the given workspace name

createContextMatchingNodeData(NodeData $nodeData)

Generates a Context that exactly fits the given NodeData Workspace, Dimensions & Site.

getUsageReferences(AssetInterface $asset)

Returns an array of usage reference objects.

array
getRelatedNodes(AssetInterface $asset)

Returns all nodes that use the asset in a node property.

Details

bool isInUse(AssetInterface $asset)

Returns true if the asset is used.

Parameters

AssetInterface $asset

Return Value

bool

int getUsageCount(AssetInterface $asset)

Returns the total count of usages found.

Parameters

AssetInterface $asset

Return Value

int

protected ContentContext createContentContext(string $workspaceName, array $dimensions = [])

Create a ContentContext based on the given workspace name

Parameters

string $workspaceName

Name of the workspace to set for the context

array $dimensions

Optional list of dimensions and their values which should be set

Return Value

ContentContext

protected ContentContext createContextMatchingNodeData(NodeData $nodeData)

Generates a Context that exactly fits the given NodeData Workspace, Dimensions & Site.

Parameters

NodeData $nodeData

Return Value

ContentContext

UsageReference[] getUsageReferences(AssetInterface $asset)

Returns an array of usage reference objects.

Parameters

AssetInterface $asset

Return Value

UsageReference[]

Exceptions

NodeConfigurationException

array getRelatedNodes(AssetInterface $asset)

Returns all nodes that use the asset in a node property.

Parameters

AssetInterface $asset

Return Value

array