CallbackController
Extends \Joomla\CMS\Cache\CacheControllerJoomla! Cache callback type object
since |
1.7.0 |
---|
Methods
__call
Magic method to proxy CacheController method calls to Cache
__call(string $name, array $arguments) : mixed
since |
1.7.0 |
---|
Arguments
- $name
string
Name of the function- $arguments
array
Array of arguments for the function
Response
mixed
__construct
Constructor
__construct(array $options)
since |
1.7.0 |
---|
Arguments
- $options
array
Array of options
_makeId
Generate a callback cache ID
_makeId(callback $callback, array $args) : string
since |
1.7.0 |
---|
Arguments
- $callback
callback
Callback to cache- $args
array
Arguments to the callback method to cache
Response
string
MD5 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
since |
1.7.0 |
---|
Arguments
- $path
array|string
A path to search.
Response
array
An array with directory elements
call
Executes a cacheable callback if not found in cache else returns cached output and result
call() : mixed
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
mixed
Result of the callback
get
Get stored cached data by ID and group
get(string $id, string $group = null) : mixed
since |
1.7.0 |
---|---|
deprecated |
4.0 Implement own method in subclass |
Arguments
- $id
string
The cache data ID- $group
string
The cache data group
Response
mixed
Boolean 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
since |
1.7.0 |
---|---|
throws |
|
Arguments
- $type
string
The cache object type to instantiate; default is output.- $options
array
Array of options
Response
store
Store data to cache by ID and group
store(mixed $data, string $id, string $group = null, boolean $wrkarounds = true) : boolean
since |
1.7.0 |
---|---|
deprecated |
4.0 Implement own method in subclass |
Arguments
- $data
mixed
The data to store- $id
string
The cache data ID- $group
string
The cache data group- $wrkarounds
boolean
True to use wrkarounds
Response
boolean
True if cache stored
Properties
options
Array of options
since |
1.7.0 |
---|
Type(s)
array