‪TYPO3CMS  ‪main
TYPO3\CMS\Core\Site\Set\SetRegistry Class Reference

Public Member Functions

 __construct (protected DependencyOrderingService $dependencyOrderingService, #[Autowire(expression:'service("package-dependent-cache-identifier").withPrefix("Sets").toString()')] protected readonly string $cacheIdentifier, #[Autowire(service:'cache.core')] protected readonly PhpFrontend $cache, #[Autowire(lazy:true)] protected SetCollector $setCollector, protected LoggerInterface $logger,)
 
list< SetDefinitiongetSets (string ... $setNames)
 
 hasSet (string $setName)
 
 getSet (string $setName)
 
 warmupCaches (CacheWarmupEvent $event)
 

Public Attributes

catch(\Error) return $this orderedSets
 
foreach($sets as $set) $this orderedSets
 
return $this orderedSets
 

Protected Member Functions

array< string, getOrderedSets():array { return $this-> orderedSets $this getFromCache () ?? $this -> computeOrderedSets()
 
array< string, computeOrderedSets():array { $tmp=[];$sets=$this-> setCollector getSetDefinitions ()
 
 hasDependency (array $setNames, string $dependency)
 

Protected Attributes

array $orderedSets = null
 
array< string, function getFromCache():?array { if(! $this->cache->has( $this->cacheIdentifier)) { return null;} try { $this-> orderedSets = $this->cache->require($this->cacheIdentifier)
 

Detailed Description

Definition at line 29 of file SetRegistry.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Core\Site\Set\SetRegistry::__construct ( protected DependencyOrderingService  $dependencyOrderingService,
# protected readonly string  $cacheIdentifier[Autowire(expression:'service("package-dependent-cache-identifier").withPrefix("Sets").toString()')],
# protected readonly PhpFrontend  $cache[Autowire(service:'cache.core')],
# protected SetCollector  $setCollector[Autowire(lazy:true)],
protected LoggerInterface  $logger 
)

Definition at line 34 of file SetRegistry.php.

Member Function Documentation

◆ getFromCache()

array<string, getOrderedSets(): array { return $this-> orderedSets $this TYPO3\CMS\Core\Site\Set\SetRegistry::getFromCache ( ) -> computeOrderedSets()
protected
Returns
‪array<string, SetDefinition>

◆ getSet()

TYPO3\CMS\Core\Site\Set\SetRegistry::getSet ( string  $setName)

Definition at line 66 of file SetRegistry.php.

Referenced by TYPO3\CMS\Core\Site\Set\SetRegistry\hasDependency().

◆ getSetDefinitions()

array<string, computeOrderedSets(): array { $tmp = []; $sets = $this-> setCollector TYPO3\CMS\Core\Site\Set\SetRegistry::getSetDefinitions ( )
protected
Returns
‪array<string, SetDefinition>

◆ getSets()

list<SetDefinition> TYPO3\CMS\Core\Site\Set\SetRegistry::getSets ( string ...  $setNames)

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

Returns
‪list<SetDefinition>

Definition at line 51 of file SetRegistry.php.

◆ hasDependency()

TYPO3\CMS\Core\Site\Set\SetRegistry::hasDependency ( array  $setNames,
string  $dependency 
)
protected

Definition at line 128 of file SetRegistry.php.

References TYPO3\CMS\Core\Site\Set\SetRegistry\getSet().

◆ hasSet()

TYPO3\CMS\Core\Site\Set\SetRegistry::hasSet ( string  $setName)

Definition at line 61 of file SetRegistry.php.

◆ warmupCaches()

TYPO3\CMS\Core\Site\Set\SetRegistry::warmupCaches ( CacheWarmupEvent  $event)

Member Data Documentation

◆ $orderedSets

array TYPO3\CMS\Core\Site\Set\SetRegistry::$orderedSets = null
protected

Definition at line 32 of file SetRegistry.php.

◆ orderedSets [1/4]

array<string, function getFromCache(): ?array { if (!$this->cache->has($this->cacheIdentifier)) { return null; } try { $this-> TYPO3\CMS\Core\Site\Set\SetRegistry::orderedSets = $this->cache->require($this->cacheIdentifier)
protected
Returns
‪array<string, SetDefinition>

Definition at line 88 of file SetRegistry.php.

◆ orderedSets [2/4]

catch (\Error) return $this TYPO3\CMS\Core\Site\Set\SetRegistry::orderedSets

Definition at line 92 of file SetRegistry.php.

◆ orderedSets [3/4]

foreach ( $sets as $set) $this TYPO3\CMS\Core\Site\Set\SetRegistry::orderedSets
Initial value:
= array_map(
static fn(array $data): SetDefinition => $data['set'],
$this->dependencyOrderingService->orderByDependencies($tmp)
)

Definition at line 120 of file SetRegistry.php.

◆ orderedSets [4/4]

return $this TYPO3\CMS\Core\Site\Set\SetRegistry::orderedSets

Definition at line 125 of file SetRegistry.php.