AspectFactory
Factory for creating aspects
Table of Contents
Properties
- $availableAspects : array<string|int, mixed>
- $context : Context
Methods
- __construct() : mixed
- AspectFactory constructor.
- createAspects() : array<string|int, AspectInterface>
- Create aspects from the given settings.
- create() : AspectInterface
- Creates an aspect
- enrich() : AspectInterface
- Checks for the language aware trait, and adds the site language.
- sortAspects() : int
- Sorts aspects with putting persisted aspects to the end, thus non-persisted aspects can be executed earlier without invoking database.
Properties
$availableAspects
protected
array<string|int, mixed>
$availableAspects
$context
protected
Context
$context
Methods
__construct()
AspectFactory constructor.
public
__construct([Context|null $context = null ]) : mixed
Parameters
- $context : Context|null = null
createAspects()
Create aspects from the given settings.
public
createAspects(array<string|int, mixed> $aspects, SiteLanguage $language, Site $site) : array<string|int, AspectInterface>
Parameters
- $aspects : array<string|int, mixed>
- $language : SiteLanguage
- $site : Site
Return values
array<string|int, AspectInterface>create()
Creates an aspect
protected
create(string $type, array<string|int, mixed> $settings) : AspectInterface
Parameters
- $type : string
- $settings : array<string|int, mixed>
Tags
Return values
AspectInterfaceenrich()
Checks for the language aware trait, and adds the site language.
protected
enrich(AspectInterface $aspect, SiteLanguage $language, Site $site) : AspectInterface
Parameters
- $aspect : AspectInterface
- $language : SiteLanguage
- $site : Site
Return values
AspectInterfacesortAspects()
Sorts aspects with putting persisted aspects to the end, thus non-persisted aspects can be executed earlier without invoking database.
protected
sortAspects(AspectInterface $first, AspectInterface $second) : int
Parameters
- $first : AspectInterface
- $second : AspectInterface