\BackendTheme\AspectPaginatorHelperAspect

Applies some Twitter Bootstrap CSS styles to Paginator elements.

Summary

Methods
Properties
Constants
defaultTemplates()
cache()
dropCache()
getProperty()
setProperty()
No public properties found
No constants found
No protected methods found
$_templates
$_cache
N/A
No private methods found
No private properties found
N/A

Properties

$_templates

$_templates : array

Custom templates for PaginatorHelper.

Type

array

$_cache

$_cache : array

Used internally.

Type

array

Methods

defaultTemplates()

defaultTemplates(\Go\Aop\Intercept\MethodInvocation $invocation) : boolean

Adds custom templates to PaginatorHelper::$_defaultConfig['templates'].

Parameters

\Go\Aop\Intercept\MethodInvocation $invocation

Joinpoint

Returns

boolean —

Whether object invocation should proceed or not

cache()

cache(null|string $key, mixed $value) : mixed

Reads, writes or search internal class's cache.

Usages:

  • When reading if no cache key is found NULL will be returned. e.g. $null = static::cache('invalid-key');
  • When writing, this method return the value that was written. e.g. $value = static::cache('key', 'value');
  • Set both arguments to NULL to read the whole cache content at the moment. e.g. $allCache = static::cache()
  • Set key to null and value to anything to find the first key holding the given value. e.g. $key = static::cache(null, 'search key for this value'), if no key for the given value is found NULL will be returned.

Examples:

Writing cache:

static::cache('user_name', 'John');
// returns 'John'

static::cache('user_last', 'Locke');
// returns 'Locke'

Reading cache:

static::cache('user_name');
// returns: John

static::cache('unexisting_key');
// returns: null

static::cache();
// Reads the entire cache
// returns: ['user_name' => 'John', 'user_last' => 'Locke']

Searching keys:

static::cache(null, 'Locke');
// returns: user_last

static::cache(null, 'Unexisting Value');
// returns: null

Parameters

null|string $key

Cache key to read or write, set both $key and $value to get the whole cache information

mixed $value

Values to write into the given $key, or null indicates reading from cache

Returns

mixed

dropCache()

dropCache(string|null $key) : void

Drops the entire cache or a specific key.

Usage:

static::dropCache('user_cache'); // removes "user_cache" only
static::dropCache(); // removes every key

Parameters

string|null $key

Cache key to clear, if NULL the entire cache will be erased.

getProperty()

getProperty(object $object, string $name) : mixed

Get property value from the given object, regardless its visibility.

Parameters

object $object

The object

string $name

Name of the property to get

Returns

mixed —

Property value

setProperty()

setProperty(object $object, string $propertyName, mixed $value) : void

Sets property value of the given object, regardless its visibility.

Parameters

object $object

The object

string $propertyName

Name of the property to set

mixed $value

The new value