PHP Class Pocket, addons

Show file Open project: vanilla/addons Class Usage Examples

Public Properties

Property Type Description
$Body $var string The text to display in the pocket.
$Disabled Whether or not the pocket is disabled. The pocket can also be in testing-mode.
$EmbeddedNever $var bool Whether to disable the pocket for embedded comments. *
$Format The format of the pocket.
$Location $var string The location on the page to display the pocket.
$MobileNever $var array The repeat frequency.
$MobileOnly $var array The repeat frequency.
$Name $var string A descriptive name for the pocket to help keep it organized.
$NameTranslations array
$Page $var string The name of the page to put the pocket on.
$RepeatFrequency $var array The repeat frequency.
$RepeatType $var string How the pocket repeats on the page.
$ShowInDashboard boolean
$Type $var string Pocket type

Public Methods

Method Description
__construct ( string $Location = '' ) Pocket constructor.
canRender ( array $Data ) : boolean Whether or not this pocket should be processed based on its state.
isAd ( ) : boolean Determine whether the pocket is of type 'ad'.
load ( array $Data ) Load the pocket's data from an array.
pageName ( null $NameOrObject = null ) : mixed | null | string
parseRepeat ( $Repeat ) : array
render ( array $Data = NULL ) Render the pocket to the page.
repeat ( string $Type, integer | array $Frequency ) Set the repeat of the pocket.
toString ( null $Data = NULL ) : mixed | string
touch ( $Name, $Value )

Method Details

__construct() public method

Pocket constructor.
public __construct ( string $Location = '' )
$Location string

canRender() public method

Whether or not this pocket should be processed based on its state.
public canRender ( array $Data ) : boolean
$Data array Data specific to the request.
return boolean

isAd() public method

Determine whether the pocket is of type 'ad'.
public isAd ( ) : boolean
return boolean

load() public method

Load the pocket's data from an array.
public load ( array $Data )
$Data array

pageName() public static method

public static pageName ( null $NameOrObject = null ) : mixed | null | string
$NameOrObject null
return mixed | null | string

parseRepeat() public static method

public static parseRepeat ( $Repeat ) : array
$Repeat
return array

render() public method

@param array $Data additional data for the pocket.
public render ( array $Data = NULL )
$Data array

repeat() public method

@param string $Type The repeat type, contained in the various Pocket::REPEAT_* constants. - every: Repeats every x times. If $Frequency is an array then it will be interpretted as array($Frequency, $Begin). - indexes: Renders only at the given indexes, starting at 1.
public repeat ( string $Type, integer | array $Frequency )
$Type string
$Frequency integer | array The frequency of the repeating, see the $Type parameter for how this works.

toString() public method

public toString ( null $Data = NULL ) : mixed | string
$Data null
return mixed | string

touch() public static method

public static touch ( $Name, $Value )
$Name
$Value

Property Details

$Body public property

$var string The text to display in the pocket.
public $Body

$Disabled public property

Whether or not the pocket is disabled. The pocket can also be in testing-mode.
public $Disabled

$EmbeddedNever public property

$var bool Whether to disable the pocket for embedded comments. *
public $EmbeddedNever

$Format public property

The format of the pocket.
public $Format

$Location public property

$var string The location on the page to display the pocket.
public $Location

$MobileNever public property

$var array The repeat frequency.
public $MobileNever

$MobileOnly public property

$var array The repeat frequency.
public $MobileOnly

$Name public property

$var string A descriptive name for the pocket to help keep it organized.
public $Name

$NameTranslations public static property

public static array $NameTranslations
return array

$Page public property

$var string The name of the page to put the pocket on.
public $Page

$RepeatFrequency public property

$var array The repeat frequency.
public $RepeatFrequency

$RepeatType public property

$var string How the pocket repeats on the page.
public $RepeatType

$ShowInDashboard public property

public bool $ShowInDashboard
return boolean

$Type public property

$var string Pocket type
public $Type