Documentation

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

Methods

__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
throws
BasicException
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|null

getAdminSidebarMenu()

public getAdminSidebarMenu([bool $reset = false ]) : array<string|int, mixed>
Parameters
$reset : bool = false
Return values
array<string|int, mixed>
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
throws
BasicException
throws
DependencyException
throws
NotFoundException
Return values
array<string|int, mixed>

getBlockRegions()

gets available block regions

public getBlockRegions() : array<string|int, mixed>
Tags
throws
BasicException
Return values
array<string|int, mixed>

getBrowserPreferredLanguage()

gets preferred language by browser configuration

public getBrowserPreferredLanguage() : string|null
Tags
throws
BasicException
throws
DependencyException
throws
NotFoundException
throws
PhpfastcacheSimpleCacheException
Return values
string|null

getCachedConfig()

get cached config

public getCachedConfig() : array<string|int, mixed>
Tags
throws
PhpfastcacheSimpleCacheException
throws
BasicException
throws
PhpfastcacheSimpleCacheException
throws
BasicException
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
throws
BasicException
throws
PhpfastcacheSimpleCacheException
throws
DependencyException
throws
NotFoundException

getContainer()

gets container object

public getContainer() : ContainerInterface
Return values
ContainerInterface

getCurrentWebsite()

gets current website id

public getCurrentWebsite() : Website|null
Tags
throws
BasicException
throws
DependencyException
throws
NotFoundException
Return values
Website|null

getCurrentWebsiteId()

gets current website id

public getCurrentWebsiteId() : int|string|null
Tags
throws
BasicException
throws
DependencyException
throws
NotFoundException
Return values
int|string|null

getDateFormat()

gets date format string

public getDateFormat([null $website_id = null ][, null $locale = null ]) : string
Parameters
$website_id : null = null
$locale : null = null
Tags
throws
BasicException
throws
PhpfastcacheSimpleCacheException
throws
DependencyException
throws
NotFoundException
Return values
string

getDateTimeFormat()

gets date format string

public getDateTimeFormat([null $website_id = null ][, null $locale = null ]) : string
Parameters
$website_id : null = null
$locale : null = null
Tags
throws
BasicException
throws
PhpfastcacheSimpleCacheException
throws
DependencyException
throws
NotFoundException
Return values
string

getDb()

gets db object

public getDb() : Database
Tags
throws
BasicException
Return values
Database

getDebugbar()

gets debugbar object

public getDebugbar() : StandardDebugBar
Tags
throws
BasicException
Return values
StandardDebugBar

getDefaultLocale()

gets default site locale

public getDefaultLocale() : string|null
Tags
throws
BasicException
throws
DependencyException
throws
NotFoundException
Return values
string|null

getEnv()

gets env variable

public getEnv(string $variable[, mixed $default = null ]) : mixed
Parameters
$variable : string
$default : mixed = null
Tags
throws
BasicException

getEventManager()

gets events manager service

public getEventManager() : SharedEventEmitter
Tags
throws
BasicException
Return values
SharedEventEmitter

getGoogleAuthenticator()

gets google authenticator service

public getGoogleAuthenticator() : PHPGangsta_GoogleAuthenticator
Tags
throws
BasicException
Return values
PHPGangsta_GoogleAuthenticator

getGuzzle()

gets guzzle service

public getGuzzle() : Client
Tags
throws
BasicException
Return values
Client

getHomePageId()

gets homepage page id

public getHomePageId([null $website_id = null ][, null $locale = null ]) : mixed
Parameters
$website_id : null = null
$locale : null = null
Tags
throws
BasicException
throws
DependencyException
throws
NotFoundException
throws
PhpfastcacheSimpleCacheException

getHomePageRedirectsToLanguage()

gets homepage redirects to default language preference

public getHomePageRedirectsToLanguage([null $website_id = null ]) : bool
Parameters
$website_id : null = null
Tags
throws
BasicException
throws
PhpfastcacheSimpleCacheException
throws
DependencyException
throws
NotFoundException
Return values
bool

getIcons()

gets icons service

public getIcons() : Icons
Tags
throws
BasicException
Return values
Icons

getImagine()

gets imagine service

public getImagine() : Imagine
Tags
throws
BasicException
Return values
Imagine

getLog()

gets log object

public getLog() : Logger
Tags
throws
BasicException
Return values
Logger

getMainMenuName()

gets main menu name

public getMainMenuName([null $website_id = null ][, null $locale = null ]) : mixed
Parameters
$website_id : null = null
$locale : null = null
Tags
throws
BasicException
throws
DependencyException
throws
NotFoundException
throws
PhpfastcacheSimpleCacheException

getPageRegions()

get page regions list

public getPageRegions() : array<string|int, mixed>
Tags
throws
BasicException
Return values
array<string|int, mixed>

getPdo()

gets PDO object

public getPdo() : PDO
Tags
throws
BasicException
Return values
PDO

getRedirects()

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
throws
BasicException
throws
PhpfastcacheSimpleCacheException
Return values
array<string|int, mixed>

getRequest()

gets current request object

public getRequest() : Request
Tags
throws
BasicException
Return values
Request

getRouters()

gets routers

public getRouters() : array<string|int, mixed>
Tags
throws
BasicException
Return values
array<string|int, mixed>

getSchema()

gets schema object

public getSchema() : Schema
Tags
throws
BasicException
Return values
Schema

getSesMailer()

gets SES mailer service

public getSesMailer() : SesClient
Tags
throws
BasicException
Return values
SesClient

getShowLogoOnMenu()

gets show logo in menu preference

public getShowLogoOnMenu([null $website_id = null ]) : bool
Parameters
$website_id : null = null
Tags
throws
BasicException
throws
PhpfastcacheSimpleCacheException
throws
DependencyException
throws
NotFoundException
Return values
bool

getSiteEmail()

gets website email address

public getSiteEmail([null $website_id = null ]) : mixed
Parameters
$website_id : null = null
Tags
throws
BasicException
throws
DependencyException
throws
NotFoundException
throws
PhpfastcacheSimpleCacheException

getSiteLocales()

gets site enabled locales

public getSiteLocales([null $website_id = null ]) : bool|array<string|int, mixed>
Parameters
$website_id : null = null
Tags
throws
BasicException
throws
PhpfastcacheSimpleCacheException
throws
DependencyException
throws
NotFoundException
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
throws
BasicException
throws
DependencyException
throws
NotFoundException
Return values
array<string|int, mixed>

getSmtpMailer()

gets SMTP mailer service

public getSmtpMailer() : Swift_Mailer
Tags
throws
BasicException
Return values
Swift_Mailer

getTemplates()

gets plates engine object

public getTemplates() : Engine
Tags
throws
BasicException
Return values
Engine

getThemeName()

gets main menu name

public getThemeName([null $website_id = null ][, null $locale = null ]) : mixed
Parameters
$website_id : null = null
$locale : null = null
Tags
throws
BasicException
throws
DependencyException
throws
NotFoundException
throws
PhpfastcacheSimpleCacheException

getTranslator()

gets translator

public getTranslator([string|null $locale_code = null ]) : Translator
Parameters
$locale_code : string|null = null
Tags
throws
DependencyException
throws
NotFoundException
Return values
Translator

preloadConfiguration()

loads configuration

public preloadConfiguration() : array<string|int, mixed>
Tags
throws
BasicException
throws
PhpfastcacheSimpleCacheException
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
throws
Exception
throws
GuzzleException
Return values
string|bool

setConfigValue()

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
bool

getService()

gets registered service

protected getService(string $service_key) : mixed
Parameters
$service_key : string
Tags
throws
BasicException

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
Tags
throws
BasicException
Return values
array<string|int, mixed>

        
On this page

Search results