SiteData
extends ContainerAwareObject
in package
Site Data Helper Class
Table of Contents
Constants
- CONFIGURATION_CACHE_KEY = 'site.configuration'
- DATE_FORMAT_PATH = 'app/frontend/date_format'
- DATE_TIME_FORMAT_PATH = 'app/frontend/date_time_format'
- DEFAULT_LOCALE = 'en'
- HOMEPAGE_ID_PATH = 'app/frontend/homepage'
- HOMEPAGE_REDIRECTS_TO_LANGUAGE_PATH = 'app/frontend/homepage_redirects_to_language'
- LOCALES_PATH = 'app/frontend/langs'
- MAINMENU_PATH = 'app/frontend/main_menu'
- MENU_LOGO_PATH = 'app/frontend/menu_with_logo'
- SITE_EMAIL_PATH = 'app/global/site_mail_address'
- THEMENAME_PATH = 'app/frontend/themename'
Properties
- $translators : array<string|int, mixed>
- $container : ContainerInterface
Methods
- __call() : mixed
- {@inheritdoc}
- __construct() : mixed
- constructor
- buildSiteMenu() : array<string|int, mixed>
- returns site menu
- containerCall() : mixed
- call method through container
- containerMake() : mixed
- create object through container
- currentServerName() : string|null
- gets current server name
- getAdminSidebarMenu() : array<string|int, mixed>
- getAdminSidebarVisibleLinks() : mixed
- getAllPageBlocks() : array<string|int, mixed>
- gets all blocks for current locale
- getApp() : App
- gets app object
- getApplicationLogger() : Manager
- gets application_logger service
- getAppRouteInfo() : RouteInfo|null
- gets route info
- getAppWebsite() : Website|null
- gets current website
- getAssets() : Manager
- gets assets manager
- getBlockRegions() : array<string|int, mixed>
- gets available block regions
- getBrowserPreferredLanguage() : string|null
- gets preferred language by browser configuration
- getCache() : Manager
- get cache manager
- getCachedConfig() : array<string|int, mixed>
- get cached config
- getConfigValue() : mixed
- gets config value
- getContainer() : ContainerInterface
- gets container object
- getCrudRouter() : Crud
- gets crud service
- getCurrentWebsite() : Website|null
- gets current website id
- getCurrentWebsiteId() : int|string|null
- gets current website id
- getDateFormat() : string
- gets date format string
- getDateTimeFormat() : string
- gets date format string
- getDb() : Database
- gets db object
- getDebugbar() : StandardDebugBar
- gets debugbar object
- getDefaultLocale() : string|null
- gets default site locale
- getEnv() : mixed
- gets env variable
- getEventManager() : SharedEventEmitter
- gets events manager service
- getGoogleAuthenticator() : PHPGangsta_GoogleAuthenticator
- gets google authenticator service
- getGuzzle() : Client
- gets guzzle service
- getHomePageId() : mixed
- gets homepage page id
- getHomePageRedirectsToLanguage() : bool
- gets homepage redirects to default language preference
- getHtmlRenderer() : HtmlPartsRenderer
- gets html renderer service
- getIcons() : Icons
- gets icons service
- getImagine() : Imagine
- gets imagine service
- getLog() : Logger
- gets log object
- getMailer() : Mailer
- gets mailer service
- getMainMenuName() : mixed
- gets main menu name
- getPageRegions() : array<string|int, mixed>
- get page regions list
- getPdo() : PDO
- gets PDO object
- getRedirects() : array<string|int, mixed>
- gets defined redirects
- getRedis() : Manager
- gets redis service
- getRequest() : Request
- gets current request object
- getRouters() : array<string|int, mixed>
- gets routers
- getSchema() : Schema
- gets schema object
- getSearch() : Manager
- gets search service
- getSesMailer() : SesClient
- gets SES mailer service
- getShowLogoOnMenu() : bool
- gets show logo in menu preference
- getSiteData() : SiteData
- gets site data service
- getSiteEmail() : mixed
- gets website email address
- getSiteLocales() : bool|array<string|int, mixed>
- gets site enabled locales
- getSiteMenu() : array<string|int, mixed>
- returns site menu
- getSmtpMailer() : Swift_Mailer
- gets SMTP mailer service
- getTemplates() : Engine
- gets plates engine object
- getThemeName() : mixed
- gets main menu name
- getTranslator() : Translator
- gets translator
- getUtils() : Globals
- gets global utils service
- getWebhooksRouter() : Webhooks
- gets webhooks service
- getWebRouter() : Web
- gets routing service
- getZip() : Zip
- gets zip service
- preloadConfiguration() : array<string|int, mixed>
- loads configuration
- requestUrl() : string|bool
- executes an http request
- setConfigValue() : bool
- sets config value
- getService() : mixed
- gets registered service
- menuElementToArray() : array<string|int, mixed>
- converts a menu element to array
Constants
CONFIGURATION_CACHE_KEY
public
mixed
CONFIGURATION_CACHE_KEY
= 'site.configuration'
DATE_FORMAT_PATH
public
mixed
DATE_FORMAT_PATH
= 'app/frontend/date_format'
DATE_TIME_FORMAT_PATH
public
mixed
DATE_TIME_FORMAT_PATH
= 'app/frontend/date_time_format'
DEFAULT_LOCALE
public
mixed
DEFAULT_LOCALE
= 'en'
HOMEPAGE_ID_PATH
public
mixed
HOMEPAGE_ID_PATH
= 'app/frontend/homepage'
HOMEPAGE_REDIRECTS_TO_LANGUAGE_PATH
public
mixed
HOMEPAGE_REDIRECTS_TO_LANGUAGE_PATH
= 'app/frontend/homepage_redirects_to_language'
LOCALES_PATH
public
mixed
LOCALES_PATH
= 'app/frontend/langs'
MAINMENU_PATH
public
mixed
MAINMENU_PATH
= 'app/frontend/main_menu'
MENU_LOGO_PATH
public
mixed
MENU_LOGO_PATH
= 'app/frontend/menu_with_logo'
SITE_EMAIL_PATH
public
mixed
SITE_EMAIL_PATH
= 'app/global/site_mail_address'
THEMENAME_PATH
public
mixed
THEMENAME_PATH
= 'app/frontend/themename'
Properties
$translators
public
static array<string|int, mixed>
$translators
= []
translators
$container
protected
ContainerInterface
$container
Methods
__call()
{@inheritdoc}
public
__call(string $name, mixed $arguments) : mixed
Parameters
- $name : string
- $arguments : mixed
Tags
__construct()
constructor
public
__construct(ContainerInterface $container) : mixed
Parameters
- $container : ContainerInterface
buildSiteMenu()
returns site menu
public
buildSiteMenu(array<string|int, mixed> $menu_items[, Menu|null $menu_element = null ][, mixed $absoluteLinks = true ]) : array<string|int, mixed>
Parameters
- $menu_items : array<string|int, mixed>
- $menu_element : Menu|null = null
- $absoluteLinks : mixed = true
Tags
Return values
array<string|int, mixed>containerCall()
call method through container
public
containerCall(callable $callable[, array<string|int, mixed> $arguments = [] ]) : mixed
Parameters
- $callable : callable
- $arguments : array<string|int, mixed> = []
containerMake()
create object through container
public
containerMake(string $className[, array<string|int, mixed> $arguments = [] ]) : mixed
Parameters
- $className : string
- $arguments : array<string|int, mixed> = []
currentServerName()
gets current server name
public
currentServerName() : string|null
Return values
string|nullgetAdminSidebarMenu()
public
getAdminSidebarMenu([bool $reset = false ]) : array<string|int, mixed>
Parameters
- $reset : bool = false
Return values
array<string|int, mixed>getAdminSidebarVisibleLinks()
public
getAdminSidebarVisibleLinks(AdminPage $controller) : mixed
Parameters
- $controller : AdminPage
getAllPageBlocks()
gets all blocks for current locale
public
getAllPageBlocks([string|null $locale = null ]) : array<string|int, mixed>
Parameters
- $locale : string|null = null
Tags
Return values
array<string|int, mixed>getApp()
gets app object
public
getApp() : App
Tags
Return values
AppgetApplicationLogger()
gets application_logger service
public
getApplicationLogger() : Manager
Tags
Return values
ManagergetAppRouteInfo()
gets route info
public
getAppRouteInfo() : RouteInfo|null
Return values
RouteInfo|nullgetAppWebsite()
gets current website
public
getAppWebsite() : Website|null
Return values
Website|nullgetAssets()
gets assets manager
public
getAssets() : Manager
Tags
Return values
ManagergetBlockRegions()
gets available block regions
public
getBlockRegions() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed>getBrowserPreferredLanguage()
gets preferred language by browser configuration
public
getBrowserPreferredLanguage() : string|null
Tags
Return values
string|nullgetCache()
get cache manager
public
getCache() : Manager
Tags
Return values
ManagergetCachedConfig()
get cached config
public
getCachedConfig() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed>getConfigValue()
gets config value
public
getConfigValue(string $config_path[, int|null $website_id = null ][, string|null $locale = null ]) : mixed
Parameters
- $config_path : string
- $website_id : int|null = null
- $locale : string|null = null
Tags
getContainer()
gets container object
public
getContainer() : ContainerInterface
Return values
ContainerInterfacegetCrudRouter()
gets crud service
public
getCrudRouter() : Crud
Tags
Return values
CrudgetCurrentWebsite()
gets current website id
public
getCurrentWebsite() : Website|null
Tags
Return values
Website|nullgetCurrentWebsiteId()
gets current website id
public
getCurrentWebsiteId() : int|string|null
Tags
Return values
int|string|nullgetDateFormat()
gets date format string
public
getDateFormat([null $website_id = null ][, null $locale = null ]) : string
Parameters
- $website_id : null = null
- $locale : null = null
Tags
Return values
stringgetDateTimeFormat()
gets date format string
public
getDateTimeFormat([null $website_id = null ][, null $locale = null ]) : string
Parameters
- $website_id : null = null
- $locale : null = null
Tags
Return values
stringgetDb()
gets db object
public
getDb() : Database
Tags
Return values
DatabasegetDebugbar()
gets debugbar object
public
getDebugbar() : StandardDebugBar
Tags
Return values
StandardDebugBargetDefaultLocale()
gets default site locale
public
getDefaultLocale() : string|null
Tags
Return values
string|nullgetEnv()
gets env variable
public
getEnv(string $variable[, mixed $default = null ]) : mixed
Parameters
- $variable : string
- $default : mixed = null
Tags
getEventManager()
gets events manager service
public
getEventManager() : SharedEventEmitter
Tags
Return values
SharedEventEmittergetGoogleAuthenticator()
gets google authenticator service
public
getGoogleAuthenticator() : PHPGangsta_GoogleAuthenticator
Tags
Return values
PHPGangsta_GoogleAuthenticatorgetGuzzle()
gets guzzle service
public
getGuzzle() : Client
Tags
Return values
ClientgetHomePageId()
gets homepage page id
public
getHomePageId([null $website_id = null ][, null $locale = null ]) : mixed
Parameters
- $website_id : null = null
- $locale : null = null
Tags
getHomePageRedirectsToLanguage()
gets homepage redirects to default language preference
public
getHomePageRedirectsToLanguage([null $website_id = null ]) : bool
Parameters
- $website_id : null = null
Tags
Return values
boolgetHtmlRenderer()
gets html renderer service
public
getHtmlRenderer() : HtmlPartsRenderer
Tags
Return values
HtmlPartsRenderergetIcons()
gets icons service
public
getIcons() : Icons
Tags
Return values
IconsgetImagine()
gets imagine service
public
getImagine() : Imagine
Tags
Return values
ImaginegetLog()
gets log object
public
getLog() : Logger
Tags
Return values
LoggergetMailer()
gets mailer service
public
getMailer() : Mailer
Tags
Return values
MailergetMainMenuName()
gets main menu name
public
getMainMenuName([null $website_id = null ][, null $locale = null ]) : mixed
Parameters
- $website_id : null = null
- $locale : null = null
Tags
getPageRegions()
get page regions list
public
getPageRegions() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed>getPdo()
gets PDO object
public
getPdo() : PDO
Tags
Return values
PDOgetRedirects()
gets defined redirects
public
getRedirects(int $current_website_id[, bool $reset = false ]) : array<string|int, mixed>
Parameters
- $current_website_id : int
- $reset : bool = false
Tags
Return values
array<string|int, mixed>getRedis()
gets redis service
public
getRedis() : Manager
Tags
Return values
ManagergetRequest()
gets current request object
public
getRequest() : Request
Tags
Return values
RequestgetRouters()
gets routers
public
getRouters() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed>getSchema()
gets schema object
public
getSchema() : Schema
Tags
Return values
SchemagetSearch()
gets search service
public
getSearch() : Manager
Tags
Return values
ManagergetSesMailer()
gets SES mailer service
public
getSesMailer() : SesClient
Tags
Return values
SesClientgetShowLogoOnMenu()
gets show logo in menu preference
public
getShowLogoOnMenu([null $website_id = null ]) : bool
Parameters
- $website_id : null = null
Tags
Return values
boolgetSiteData()
gets site data service
public
getSiteData() : SiteData
Tags
Return values
SiteDatagetSiteEmail()
gets website email address
public
getSiteEmail([null $website_id = null ]) : mixed
Parameters
- $website_id : null = null
Tags
getSiteLocales()
gets site enabled locales
public
getSiteLocales([null $website_id = null ]) : bool|array<string|int, mixed>
Parameters
- $website_id : null = null
Tags
Return values
bool|array<string|int, mixed>getSiteMenu()
returns site menu
public
getSiteMenu(string $menu_name, int $website_id, string $locale[, Menu|null $menu_element = null ][, mixed $absoluteLinks = true ]) : array<string|int, mixed>
Parameters
- $menu_name : string
- $website_id : int
- $locale : string
- $menu_element : Menu|null = null
- $absoluteLinks : mixed = true
Tags
Return values
array<string|int, mixed>getSmtpMailer()
gets SMTP mailer service
public
getSmtpMailer() : Swift_Mailer
Tags
Return values
Swift_MailergetTemplates()
gets plates engine object
public
getTemplates() : Engine
Tags
Return values
EnginegetThemeName()
gets main menu name
public
getThemeName([null $website_id = null ][, null $locale = null ]) : mixed
Parameters
- $website_id : null = null
- $locale : null = null
Tags
getTranslator()
gets translator
public
getTranslator([string|null $locale_code = null ]) : Translator
Parameters
- $locale_code : string|null = null
Tags
Return values
TranslatorgetUtils()
gets global utils service
public
getUtils() : Globals
Tags
Return values
GlobalsgetWebhooksRouter()
gets webhooks service
public
getWebhooksRouter() : Webhooks
Tags
Return values
WebhooksgetWebRouter()
gets routing service
public
getWebRouter() : Web
Tags
Return values
WebgetZip()
gets zip service
public
getZip() : Zip
Tags
Return values
ZippreloadConfiguration()
loads configuration
public
preloadConfiguration() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed>requestUrl()
executes an http request
public
requestUrl(string $url[, string $method = 'GET' ][, array<string|int, mixed> $options = [] ]) : string|bool
Parameters
- $url : string
- $method : string = 'GET'
- $options : array<string|int, mixed> = []
Tags
Return values
string|boolsetConfigValue()
sets config value
public
setConfigValue(string $config_path, mixed $value[, int|null $website_id = null ][, string|null $locale = null ]) : bool
Parameters
- $config_path : string
- $value : mixed
- $website_id : int|null = null
- $locale : string|null = null
Return values
boolgetService()
gets registered service
protected
getService(string $service_key) : mixed
Parameters
- $service_key : string
Tags
menuElementToArray()
converts a menu element to array
protected
menuElementToArray(Menu $menu_element[, bool $absolute = true ]) : array<string|int, mixed>
Parameters
- $menu_element : Menu
- $absolute : bool = true