PHP Класс Backend\Core\Engine\Model

Наследование: extends Common\Core\Model
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
checkSettings ( ) : array Checks the settings and optionally returns an array with warnings
createURLForAction ( string $action = null, string $module = null, string $language = null, array $parameters = null, boolean $urlencode = true ) : string Creates an URL for a given action and module If you don't specify an action the current action will be used.
deleteExtra ( string $module = null, string $type = null, array $data = null ) Delete a page extra by module, type or data.
deleteExtraById ( integer $id, boolean $deleteBlock = false ) Delete a page extra by its id
deleteExtrasForData ( string $module, string $field, string $value, string $action = null ) Delete all extras for a certain value in the data array of that module_extra.
deleteThumbnails ( string $path, string $thumbnail ) Delete thumbnails based on the folders in the path
generateRandomString ( integer $length = 15, boolean $numeric = true, boolean $lowercase = true, boolean $uppercase = true, boolean $special = true ) : string Generate a random string
getDateFormatsLong ( ) : array Fetch the list of long date formats including examples of these formats.
getDateFormatsShort ( ) : array Fetch the list of short date formats including examples of these formats.
getExtras ( array $ids ) : array Get extras
getExtrasForData ( string $module, string $key, string $value, string $action = null ) : array Get extras for data
getKeys ( string $language = null ) : array Get the page-keys
getModulesForDropDown ( ) : array Fetch the list of modules, but for a dropdown.
getModulesOnFilesystem ( boolean $includeCore = true ) : array Get the modules that are available on the filesystem
getNavigation ( string $language = null ) : array Get the navigation-items
getNumberFormats ( ) : array Fetch the list of number formats including examples of these formats.
getTimeFormats ( ) : array Fetch the list of time formats including examples of these formats.
getToken ( ) : string Get the token which will protect us
getURL ( integer $pageId, string $language = null ) : string Get URL for a given pageId
getURLForBlock ( string $module, string $action = null, string $language = null, array $data = null ) : string Get the URL for a give module & action combination
imageDelete ( string $module, string $filename, string $subDirectory = '', array $fileSizes = null ) Image Delete
insertExtra ( string $type, string $module, string $action = null, string $label = null, array $data = null, boolean $hidden = false, integer $sequence = null ) : integer Insert extra
invalidateFrontendCache ( string $module = null, string $language = null )
isModuleInstalled ( string $module ) : boolean Is module installed?
ping ( string $pageOrFeedURL = null, string $category = null ) : boolean Ping the known webservices
submitHam ( string $userIp, string $userAgent, string $content, string $author = null, string $email = null, string $url = null, string $permalink = null, string $type = null, string $referrer = null, array $others = null ) : boolean Submit ham, this call is intended for the marking of false positives, things that were incorrectly marked as spam.
submitSpam ( string $userIp, string $userAgent, string $content, string $author = null, string $email = null, string $url = null, string $permalink = null, string $type = null, string $referrer = null, array $others = null ) : boolean Submit spam, his call is for submitting comments that weren't marked as spam but should have been.
updateExtra ( integer $id, string $key, string $value ) Update extra
updateExtraData ( integer $id, string $key, string $value ) Update extra data

Описание методов

checkSettings() публичный статический Метод

Checks the settings and optionally returns an array with warnings
public static checkSettings ( ) : array
Результат array

createURLForAction() публичный статический Метод

If you don't specify a module the current module will be used. If you don't specify a language the current language will be used.
public static createURLForAction ( string $action = null, string $module = null, string $language = null, array $parameters = null, boolean $urlencode = true ) : string
$action string The action to build the URL for.
$module string The module to build the URL for.
$language string The language to use, if not provided we will use the working language.
$parameters array GET-parameters to use.
$urlencode boolean Should the parameters be urlencoded?
Результат string

deleteExtra() публичный статический Метод

Data is a key/value array. Example: array(id => 23, language => nl);
public static deleteExtra ( string $module = null, string $type = null, array $data = null )
$module string The module wherefore the extra exists.
$type string The type of extra, possible values are block, homepage, widget.
$data array Extra data that exists.

deleteExtraById() публичный статический Метод

Delete a page extra by its id
public static deleteExtraById ( integer $id, boolean $deleteBlock = false )
$id integer The id of the extra to delete.
$deleteBlock boolean Should the block be deleted? Default is false.

deleteExtrasForData() публичный статический Метод

Delete all extras for a certain value in the data array of that module_extra.
public static deleteExtrasForData ( string $module, string $field, string $value, string $action = null )
$module string The module for the extra.
$field string The field of the data you want to check the value for.
$value string The value to check the field for.
$action string In case you want to search for a certain action.

deleteThumbnails() публичный статический Метод

Delete thumbnails based on the folders in the path
public static deleteThumbnails ( string $path, string $thumbnail )
$path string The path wherein the thumbnail-folders exist.
$thumbnail string The filename to be deleted.

generateRandomString() публичный статический Метод

Generate a random string
public static generateRandomString ( integer $length = 15, boolean $numeric = true, boolean $lowercase = true, boolean $uppercase = true, boolean $special = true ) : string
$length integer Length of random string.
$numeric boolean Use numeric characters.
$lowercase boolean Use alphanumeric lowercase characters.
$uppercase boolean Use alphanumeric uppercase characters.
$special boolean Use special characters.
Результат string

getDateFormatsLong() публичный статический Метод

Fetch the list of long date formats including examples of these formats.
public static getDateFormatsLong ( ) : array
Результат array

getDateFormatsShort() публичный статический Метод

Fetch the list of short date formats including examples of these formats.
public static getDateFormatsShort ( ) : array
Результат array

getExtras() публичный статический Метод

Get extras
public static getExtras ( array $ids ) : array
$ids array The ids of the modules_extras to get.
Результат array

getExtrasForData() публичный статический Метод

Get extras for data
public static getExtrasForData ( string $module, string $key, string $value, string $action = null ) : array
$module string The module for the extra.
$key string The key of the data you want to check the value for.
$value string The value to check the key for.
$action string In case you want to search for a certain action.
Результат array The ids for the extras.

getKeys() публичный статический Метод

Get the page-keys
public static getKeys ( string $language = null ) : array
$language string The language to use, if not provided we will use the working language.
Результат array

getModulesForDropDown() публичный статический Метод

Fetch the list of modules, but for a dropdown.
public static getModulesForDropDown ( ) : array
Результат array

getModulesOnFilesystem() публичный статический Метод

Get the modules that are available on the filesystem
public static getModulesOnFilesystem ( boolean $includeCore = true ) : array
$includeCore boolean Should core be included as a module?
Результат array

getNavigation() публичный статический Метод

Get the navigation-items
public static getNavigation ( string $language = null ) : array
$language string The language to use, if not provided we will use the working language.
Результат array

getNumberFormats() публичный статический Метод

Fetch the list of number formats including examples of these formats.
public static getNumberFormats ( ) : array
Результат array

getTimeFormats() публичный статический Метод

Fetch the list of time formats including examples of these formats.
public static getTimeFormats ( ) : array
Результат array

getToken() публичный статический Метод

Get the token which will protect us
public static getToken ( ) : string
Результат string

getURL() публичный статический Метод

Get URL for a given pageId
public static getURL ( integer $pageId, string $language = null ) : string
$pageId integer The id of the page to get the URL for.
$language string The language to use, if not provided we will use the working language.
Результат string

getURLForBlock() публичный статический Метод

Get the URL for a give module & action combination
public static getURLForBlock ( string $module, string $action = null, string $language = null, array $data = null ) : string
$module string The module wherefore the URL should be build.
$action string The specific action wherefore the URL should be build.
$language string The language wherein the URL should be retrieved, if not provided we will load the language that was provided in the URL.
$data array An array with keys and values that partially or fully match the data of the block. If it matches multiple versions of that block it will just return the first match.
Результат string

imageDelete() публичный статический Метод

Image Delete
public static imageDelete ( string $module, string $filename, string $subDirectory = '', array $fileSizes = null )
$module string Module name.
$filename string Filename.
$subDirectory string Subdirectory.
$fileSizes array Possible file sizes.

insertExtra() публичный статический Метод

Insert extra
public static insertExtra ( string $type, string $module, string $action = null, string $label = null, array $data = null, boolean $hidden = false, integer $sequence = null ) : integer
$type string What type do you want to insert, 'homepage', 'block' or 'widget'.
$module string The module you are inserting this extra for.
$action string The action this extra will use.
$label string Label which will be used when you want to connect this block.
$data array Containing extra variables.
$hidden boolean Should this extra be visible in frontend or not?
$sequence integer
Результат integer The new extra id

invalidateFrontendCache() публичный статический Метод

Устаревший: : twig doesn't contain this same type of caching out of the box. Use https://github.com/asm89/twig-cache-extension instead
public static invalidateFrontendCache ( string $module = null, string $language = null )
$module string A specific module to clear the cache for.
$language string The language to use.

isModuleInstalled() публичный статический Метод

Is module installed?
public static isModuleInstalled ( string $module ) : boolean
$module string
Результат boolean

ping() публичный статический Метод

Ping the known webservices
Устаревший:
public static ping ( string $pageOrFeedURL = null, string $category = null ) : boolean
$pageOrFeedURL string The page/feed that has changed.
$category string An optional category for the site.
Результат boolean If everything went fne true will, otherwise false.

submitHam() публичный статический Метод

Submit ham, this call is intended for the marking of false positives, things that were incorrectly marked as spam.
public static submitHam ( string $userIp, string $userAgent, string $content, string $author = null, string $email = null, string $url = null, string $permalink = null, string $type = null, string $referrer = null, array $others = null ) : boolean
$userIp string IP address of the comment submitter.
$userAgent string User agent information.
$content string The content that was submitted.
$author string Submitted name with the comment.
$email string Submitted email address.
$url string Commenter URL.
$permalink string The permanent location of the entry the comment was submitted to.
$type string May be blank, comment, trackback, pingback, or a made up value like "registration".
$referrer string The content of the HTTP_REFERER header should be sent here.
$others array Other data (the variables from $_SERVER).
Результат boolean If everything went fine, true will be returned, otherwise an exception will be triggered.

submitSpam() публичный статический Метод

Submit spam, his call is for submitting comments that weren't marked as spam but should have been.
public static submitSpam ( string $userIp, string $userAgent, string $content, string $author = null, string $email = null, string $url = null, string $permalink = null, string $type = null, string $referrer = null, array $others = null ) : boolean
$userIp string IP address of the comment submitter.
$userAgent string User agent information.
$content string The content that was submitted.
$author string Submitted name with the comment.
$email string Submitted email address.
$url string Commenter URL.
$permalink string The permanent location of the entry the comment was submitted to.
$type string May be blank, comment, trackback, pingback, or a made up value like "registration".
$referrer string The content of the HTTP_REFERER header should be sent here.
$others array Other data (the variables from $_SERVER).
Результат boolean If everything went fine true will be returned, otherwise an exception will be triggered.

updateExtra() публичный статический Метод

Update extra
public static updateExtra ( integer $id, string $key, string $value )
$id integer The id for the extra.
$key string The key you want to update.
$value string The new value.

updateExtraData() публичный статический Метод

Update extra data
public static updateExtraData ( integer $id, string $key, string $value )
$id integer The id for the extra.
$key string The key in the data you want to update.
$value string The new value.