SetRegistry

class \TYPO3\CMS\Core\Site\Set\SetRegistry

Attributes

#[Autoconfigure]
$public: true

Table of Contents

Properties

$cache  : PhpFrontend
$cacheIdentifier  : string
$dependencyOrderingService  : DependencyOrderingService
$invalidSets  : array<string, array{error: SetError, name: string, context: string}>
$logger  : LoggerInterface
$orderedSets  : array<int, SetDefinition>|null
$setCollector  : SetCollector

Methods

__construct()  : mixed
getAllSets()  : array<string, SetDefinition>
getInvalidSets()  : array<string, array{error: SetError, name: string, context: string}>
getSet()  : SetDefinition|null
getSets()  : array<int, SetDefinition>
Retrieve list of ordered sets, matched by $setNames, including their dependencies (recursive)
hasSet()  : bool
warmupCaches()  : void
addSetWithDependencies()  : void
checkCircularDependencies()  : string|null
Optional dependencies are followed as well, since they take part in the ordering.
checkMissingDependencies()  : string|null
computeOrderedSets()  : array<string, SetDefinition>
getFromCache()  : array<string, SetDefinition>
getOrderedSets()  : array<string, SetDefinition>

Properties

$cacheIdentifier read-only

protected string $cacheIdentifier

Attributes

#[Autowire]
$expression: 'service("package-dependent-cache-identifier").withPrefix("Sets").toString()'

$invalidSets

protected array<string, array{error: SetError, name: string, context: string}> $invalidSets = null

Methods

getInvalidSets()

public getInvalidSets() : array<string, array{error: SetError, name: string, context: string}>

Return values

array<string, array{error: SetError, name: string, context: string}>

getSets()

Retrieve list of ordered sets, matched by $setNames, including their dependencies (recursive)

public getSets(string ...$setNames) : array<int, SetDefinition>

The sets are ordered the way they are requested, each of them preceded by the sets it depends on. A set reached more than once keeps its first position, so a set always comes after its dependencies, and two sets without a dependency relation between them keep the order of $setNames.

Parameters

$setNames : string

Return values

array<int, SetDefinition>

hasSet()

public hasSet(string $setName) : bool

Parameters

$setName : string

Return values

bool

addSetWithDependencies()

protected addSetWithDependencies(array<string, SetDefinition> $availableSets, string $setName, array<string, SetDefinition> &$sets, array<string, true> &$visiting) : void

Parameters

$availableSets : array<string, SetDefinition>
$setName : string
$sets : array<string, SetDefinition>
$visiting : array<string, true>

checkCircularDependencies()

Optional dependencies are followed as well, since they take part in the ordering.

protected checkCircularDependencies(array $sets, SetDefinition $set[, array<string, true> $path = [] ][, array<string, true> &$checked = [] ]) : string|null

Parameters

$sets : array
$set : SetDefinition
$path : array<string, true> = []

The sets on the way to $set

$checked : array<string, true> = []

Sets whose dependencies have been checked without finding a cycle

Return values

string|null

checkMissingDependencies()

protected checkMissingDependencies(array $sets, SetDefinition $set[, array<string, true> $path = [] ]) : string|null

Parameters

$sets : array
$set : SetDefinition
$path : array<string, true> = []

The sets on the way to $set, a dependency on one of them is a cycle and reported by checkCircularDependencies()

Return values

string|null
On this page