‪TYPO3CMS  10.4
TYPO3\CMS\Core\Routing\Aspect\AspectFactory Class Reference

Public Member Functions

 __construct (Context $context=null)
 
AspectInterface[] createAspects (array $aspects, SiteLanguage $language, Site $site)
 

Protected Member Functions

AspectInterface create (string $type, array $settings)
 
AspectInterface enrich (AspectInterface $aspect, SiteLanguage $language, Site $site)
 
int sortAspects (AspectInterface $first, AspectInterface $second)
 

Protected Attributes

array $availableAspects
 
Context $context
 

Detailed Description

Factory for creating aspects

Definition at line 32 of file AspectFactory.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Core\Routing\Aspect\AspectFactory::__construct ( Context  $context = null)

AspectFactory constructor.

Parameters
Context$context

Definition at line 47 of file AspectFactory.php.

References TYPO3\CMS\Core\Routing\Aspect\AspectFactory\$context, and $GLOBALS.

Member Function Documentation

◆ create()

AspectInterface TYPO3\CMS\Core\Routing\Aspect\AspectFactory::create ( string  $type,
array  $settings 
)
protected

Creates an aspect

Parameters
string$type
array$settings
Returns
AspectInterface
Exceptions

Definition at line 84 of file AspectFactory.php.

Referenced by TYPO3\CMS\Core\Routing\Aspect\AspectFactory\createAspects().

◆ createAspects()

AspectInterface [] TYPO3\CMS\Core\Routing\Aspect\AspectFactory::createAspects ( array  $aspects,
SiteLanguage  $language,
Site  $site 
)

Create aspects from the given settings.

Parameters
array$aspects
SiteLanguage$language
Site$site
Returns
AspectInterface[]

Definition at line 61 of file AspectFactory.php.

References TYPO3\CMS\Core\Routing\Aspect\AspectFactory\create(), and TYPO3\CMS\Core\Routing\Aspect\AspectFactory\enrich().

◆ enrich()

AspectInterface TYPO3\CMS\Core\Routing\Aspect\AspectFactory::enrich ( AspectInterface  $aspect,
SiteLanguage  $language,
Site  $site 
)
protected

Checks for the language aware trait, and adds the site language.

Parameters
AspectInterface$aspect
SiteLanguage$language
Site$site
Returns
AspectInterface

Definition at line 113 of file AspectFactory.php.

Referenced by TYPO3\CMS\Core\Routing\Aspect\AspectFactory\createAspects().

◆ sortAspects()

int TYPO3\CMS\Core\Routing\Aspect\AspectFactory::sortAspects ( AspectInterface  $first,
AspectInterface  $second 
)
protected

Sorts aspects with putting persisted aspects to the end, thus non-persisted aspects can be executed earlier without invoking database.

Parameters
AspectInterface$first
AspectInterface$second
Returns
‪int

Definition at line 137 of file AspectFactory.php.

Member Data Documentation

◆ $availableAspects

array TYPO3\CMS\Core\Routing\Aspect\AspectFactory::$availableAspects
protected

Definition at line 36 of file AspectFactory.php.

◆ $context

Context TYPO3\CMS\Core\Routing\Aspect\AspectFactory::$context
protected