CallbackController

Extends CacheController

Joomla! Cache callback type object

since

1.7.0

package

Joomla CMS

Methods

__call

Magic method to proxy CacheController method calls to Cache

__call(string name, array arguments) : mixed
inherited
since

1.7.0

Arguments

name

stringName of the function

arguments

arrayArray of arguments for the function

Response

mixed

__construct

Constructor

__construct(array options) : mixed
inherited
since

1.7.0

Arguments

options

arrayArray of options

Response

mixed

_makeId

Generate a callback cache ID

_makeId(callable callback, array args) : string
since

1.7.0

Arguments

callback

callableCallback to cache

args

arrayArguments to the callback method to cache

Response

stringMD5 Hash

addIncludePath

Add a directory where Cache should search for controllers. You may either pass a string or an array of directories.

addIncludePath(array|string path = '') : array
inherited static
since

1.7.0

Arguments

path

array|stringA path to search.

Response

arrayAn array with directory elements

call

Executes a cacheable callback if not found in cache else returns cached output and result

call() : mixed
deprecated

Since arguments to this function are read with func_get_args you can pass any number of arguments to this method as long as the first argument passed is the callback definition.

The callback definition can be in several forms:

  • Standard PHP Callback array see https://www.php.net/callback [recommended]
  • Function name as a string eg. 'foo' for function foo()
  • Static method name as a string eg. 'MyClass::myMethod' for method myMethod() of class MyClass
since

1.7.0

deprecated

4.0

Response

mixedResult of the callback

get

Get stored cached data by ID and group

get(string id, string group = null) : mixed
inherited deprecated
since

1.7.0

deprecated

4.0 Implement own method in subclass

Arguments

id

stringThe cache data ID

group

stringThe cache data group

Response

mixedBoolean false on no result, cached object otherwise

getInstance

Returns a reference to a cache adapter object, always creating it

getInstance(string type = 'output', array options = array()) : \Joomla\CMS\Cache\CacheController
inherited static
since

1.7.0

throws

\RuntimeException

Arguments

type

stringThe cache object type to instantiate; default is output.

options

arrayArray of options

Response

\Joomla\CMS\Cache\CacheController

store

Store data to cache by ID and group

store(mixed data, string id, string group = null, bool wrkarounds = true) : bool
inherited deprecated
since

1.7.0

deprecated

4.0 Implement own method in subclass

Arguments

data

mixedThe data to store

id

stringThe cache data ID

group

stringThe cache data group

wrkarounds

boolTrue to use wrkarounds

Response

boolTrue if cache stored

Properties

cache

Cache object

inherited
since

1.7.0

Type(s)

\Joomla\CMS\Cache\Cache

options

Array of options

inherited
since

1.7.0

Type(s)

array