RulesService
extends Service
in package
Table of Contents
- RULES_CACHE_TAG = 'themes::rules'
- $cache : CacheInterface
- $cacheEnabled : bool
- $console : string|null
- $cp : string|null
- $default : string
- $mobileDetect : MobileDetect
- $rules : array<string|int, mixed>
- $setConsole : bool
- $setCp : bool
- flushCache() : mixed
- Flush rules cache
- resolveCurrentTheme() : ThemeInterface|null
- Resolve the theme for the current request, get the theme either from cache or from defined theme rules
- blockCacheService() : BlockCacheService
- Get the block cache service
- blockProviderService() : BlockProvidersService
- Get the block providers service
- blocksService() : BlockService
- Get the blocks service
- displayService() : DisplayService
- Get the display service
- eagerLoadingService() : EagerLoadingService
- Get the eager loading service
- fieldDisplayersService() : FieldDisplayerService
- Get the field displayers service
- fieldsService() : FieldsService
- Get the fields service
- fileDisplayerService() : FileDisplayerService
- Get the file displayers service
- getCache() : Array|false
- Get the cached theme name for a url
- getViewPort() : string
- Get user's view port
- groupsService() : GroupsService
- Get the groups service
- layoutService() : LayoutService
- Get the layout service
- matrixService() : MatrixService
- Get the matrix service
- resolveLanguageRule() : bool
- Resolves the language part of a rule
- resolvePathRule() : bool
- Resolves the path part of a rule
- resolveRules() : string|null
- Resolve all defined rules, returns theme name
- resolveSiteRule() : bool
- Resolves the site part of a rule
- resolveViewPortRule() : bool
- Resolves the view port part of a rule
- setCache() : mixed
- Set the theme name cache
- themesRegistry() : ThemesRegistry
- Get the themes registry
- triggerEvent() : mixed
- Triggers an event
- viewModesService() : ViewModeService
- Get the view mode service
- viewService() : ViewService
- Get the view service
Constants
RULES_CACHE_TAG
public
mixed
RULES_CACHE_TAG
= 'themes::rules'
Properties
$cache
public
CacheInterface
$cache
$cacheEnabled
public
bool
$cacheEnabled
$console
public
string|null
$console
$cp
public
string|null
$cp
$default
public
string
$default
$mobileDetect
public
MobileDetect
$mobileDetect
$rules
public
array<string|int, mixed>
$rules
$setConsole
public
bool
$setConsole
$setCp
public
bool
$setCp
Methods
flushCache()
Flush rules cache
public
flushCache() : mixed
Return values
mixed —resolveCurrentTheme()
Resolve the theme for the current request, get the theme either from cache or from defined theme rules
public
resolveCurrentTheme() : ThemeInterface|null
Return values
ThemeInterface|null —blockCacheService()
Get the block cache service
protected
blockCacheService() : BlockCacheService
Return values
BlockCacheService —blockProviderService()
Get the block providers service
protected
blockProviderService() : BlockProvidersService
Return values
BlockProvidersService —blocksService()
Get the blocks service
protected
blocksService() : BlockService
Return values
BlockService —displayService()
Get the display service
protected
displayService() : DisplayService
Return values
DisplayService —eagerLoadingService()
Get the eager loading service
protected
eagerLoadingService() : EagerLoadingService
Return values
EagerLoadingService —fieldDisplayersService()
Get the field displayers service
protected
fieldDisplayersService() : FieldDisplayerService
Return values
FieldDisplayerService —fieldsService()
Get the fields service
protected
fieldsService() : FieldsService
Return values
FieldsService —fileDisplayerService()
Get the file displayers service
protected
fileDisplayerService() : FileDisplayerService
Return values
FileDisplayerService —getCache()
Get the cached theme name for a url
protected
getCache(string $url, string $viewPort) : Array|false
Parameters
- $url : string
- $viewPort : string
Return values
Array|false —getViewPort()
Get user's view port
protected
getViewPort() : string
Return values
string —groupsService()
Get the groups service
protected
groupsService() : GroupsService
Return values
GroupsService —layoutService()
Get the layout service
protected
layoutService() : LayoutService
Return values
LayoutService —matrixService()
Get the matrix service
protected
matrixService() : MatrixService
Return values
MatrixService —resolveLanguageRule()
Resolves the language part of a rule
protected
resolveLanguageRule(string $ruleLanguage, Locale $locale) : bool
Parameters
- $ruleLanguage : string
- $locale : Locale
Return values
bool —resolvePathRule()
Resolves the path part of a rule
protected
resolvePathRule(string $ruleUrl, string $path) : bool
Parameters
- $ruleUrl : string
- $path : string
Return values
bool —resolveRules()
Resolve all defined rules, returns theme name
protected
resolveRules(string $currentPath, Site $currentSite, string $currentViewPort) : string|null
Parameters
- $currentPath : string
- $currentSite : Site
- $currentViewPort : string
Return values
string|null —resolveSiteRule()
Resolves the site part of a rule
protected
resolveSiteRule(string $ruleSite, Site $site) : bool
Parameters
- $ruleSite : string
- $site : Site
Return values
bool —resolveViewPortRule()
Resolves the view port part of a rule
protected
resolveViewPortRule(string $ruleViewPort, string $viewPort) : bool
Parameters
- $ruleViewPort : string
- $viewPort : string
Return values
bool —setCache()
Set the theme name cache
protected
setCache(string $url, string $viewPort, string $themeName) : mixed
Parameters
- $url : string
- $viewPort : string
- $themeName : string
Return values
mixed —themesRegistry()
Get the themes registry
protected
themesRegistry() : ThemesRegistry
Return values
ThemesRegistry —triggerEvent()
Triggers an event
protected
triggerEvent(string $type, Event $event) : mixed
Parameters
- $type : string
- $event : Event
Return values
mixed —viewModesService()
Get the view mode service
protected
viewModesService() : ViewModeService
Return values
ViewModeService —viewService()
Get the view service
protected
viewService() : ViewService