PHP Class Backend\Core\Engine\Model

Inheritance: extends Common\Core\Model
Afficher le fichier Open project: forkcms/forkcms Class Usage Examples

Méthodes publiques

Méthode Description
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

Method Details

checkSettings() public static méthode

Checks the settings and optionally returns an array with warnings
public static checkSettings ( ) : array
Résultat array

createURLForAction() public static méthode

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?
Résultat string

deleteExtra() public static méthode

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() public static méthode

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() public static méthode

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() public static méthode

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() public static méthode

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.
Résultat string

getDateFormatsLong() public static méthode

Fetch the list of long date formats including examples of these formats.
public static getDateFormatsLong ( ) : array
Résultat array

getDateFormatsShort() public static méthode

Fetch the list of short date formats including examples of these formats.
public static getDateFormatsShort ( ) : array
Résultat array

getExtras() public static méthode

Get extras
public static getExtras ( array $ids ) : array
$ids array The ids of the modules_extras to get.
Résultat array

getExtrasForData() public static méthode

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.
Résultat array The ids for the extras.

getKeys() public static méthode

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.
Résultat array

getModulesForDropDown() public static méthode

Fetch the list of modules, but for a dropdown.
public static getModulesForDropDown ( ) : array
Résultat array

getModulesOnFilesystem() public static méthode

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?
Résultat array

getNavigation() public static méthode

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.
Résultat array

getNumberFormats() public static méthode

Fetch the list of number formats including examples of these formats.
public static getNumberFormats ( ) : array
Résultat array

getTimeFormats() public static méthode

Fetch the list of time formats including examples of these formats.
public static getTimeFormats ( ) : array
Résultat array

getToken() public static méthode

Get the token which will protect us
public static getToken ( ) : string
Résultat string

getURL() public static méthode

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.
Résultat string

getURLForBlock() public static méthode

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.
Résultat string

imageDelete() public static méthode

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() public static méthode

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
Résultat integer The new extra id

invalidateFrontendCache() public static méthode

Deprecation: : 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() public static méthode

Is module installed?
public static isModuleInstalled ( string $module ) : boolean
$module string
Résultat boolean

ping() public static méthode

Ping the known webservices
Deprecation:
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.
Résultat boolean If everything went fne true will, otherwise false.

submitHam() public static méthode

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).
Résultat boolean If everything went fine, true will be returned, otherwise an exception will be triggered.

submitSpam() public static méthode

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).
Résultat boolean If everything went fine true will be returned, otherwise an exception will be triggered.

updateExtra() public static méthode

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() public static méthode

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.