PHP Class Frontend\Core\Engine\Model

Inheritance: extends Common\Core\Model
Show file Open project: forkcms/forkcms Class Usage Examples

Public Methods

Method Description
addURLParameters ( string $url, array $parameters ) : string Add parameters to an URL
convertToPlainText ( string $text, boolean $includeAHrefs = true, boolean $includeImgAlts = true ) : string Get plain text for a given text
getPage ( integer $pageId ) : array Get all data for a page
getPageRevision ( integer $revisionId ) : array Get a revision for a page
getVisitorId ( ) : string Get the visitor's id (using a tracking cookie)
isSpam ( string $content, string $permaLink, string $author = null, string $email = null, string $url = null, string $type = 'comment' ) : boolean | string General method to check if something is spam
pushToAppleApp ( mixed $alert, integer $badge = null, string $sound = null, array $extraDictionaries = null ) Push a notification to Apple's notifications-server

Method Details

addURLParameters() public static method

Add parameters to an URL
public static addURLParameters ( string $url, array $parameters ) : string
$url string The URL to append the parameters too.
$parameters array The parameters as key-value-pairs.
return string

convertToPlainText() public static method

Get plain text for a given text
public static convertToPlainText ( string $text, boolean $includeAHrefs = true, boolean $includeImgAlts = true ) : string
$text string The text to convert.
$includeAHrefs boolean Should the url be appended after the link-text?
$includeImgAlts boolean Should the alt tag be inserted for images?
return string

getPage() public static method

Get all data for a page
public static getPage ( integer $pageId ) : array
$pageId integer The pageId wherefore the data will be retrieved.
return array

getPageRevision() public static method

Get a revision for a page
public static getPageRevision ( integer $revisionId ) : array
$revisionId integer The revisionID.
return array

getVisitorId() public static method

Get the visitor's id (using a tracking cookie)
public static getVisitorId ( ) : string
return string

isSpam() public static method

General method to check if something is spam
public static isSpam ( string $content, string $permaLink, string $author = null, string $email = null, string $url = null, string $type = 'comment' ) : boolean | string
$content string The content that was submitted.
$permaLink string The permanent location of the entry the comment was submitted to.
$author string Commenter's name.
$email string Commenter's email address.
$url string Commenter's URL.
$type string May be blank, comment, trackback, pingback, or a made up value like "registration".
return boolean | string Will return a boolean, except when we can't decide the status (unknown will be returned in that case)

pushToAppleApp() public static method

Push a notification to Apple's notifications-server
Deprecation: : no more support for the Fork-app.
public static pushToAppleApp ( mixed $alert, integer $badge = null, string $sound = null, array $extraDictionaries = null )
$alert mixed The message/dictionary to send.
$badge integer The number for the badge.
$sound string The sound that should be played.
$extraDictionaries array Extra dictionaries.