CallbackController
Extends CacheControllerJoomla! Cache callback type object
since |
1.7.0 |
---|---|
package |
Joomla CMS |
Methods
__call
Magic method to proxy CacheController method calls to Cache
__call( name, mixed||string|int arguments) :
since |
1.7.0 |
---|
Arguments
- name
string
Name of the function- arguments
array<string|int, mixed>
Array of arguments for the function
Response
mixed
__construct
Constructor
__construct(mixed||string|int options) :
since |
1.7.0 |
---|
Arguments
- options
array<string|int, mixed>
Array of options
Response
mixed
_makeId
Generate a callback cache ID
_makeId( callback, mixed||string|int args) :
since |
1.7.0 |
---|
Arguments
- callback
mixed
Callback to cache- args
array<string|int, mixed>
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 = '') : mixed||string|int
since |
1.7.0 |
---|---|
deprecated |
4.2 will be removed in 6.0 Use the cache controller factory instead Example: Factory::getContainer()->get(CacheControllerFactoryInterface::class)->createCacheController($type, $options); |
Arguments
- path
array<string|int, mixed>|string
A path to search.
Response
array<string|int, mixed>
An array with directory elements
get
Executes a cacheable callback if not found in cache else returns cached output and result
get( Warning: Array to string conversion in /opt/phpdoc/vendor/twig/twig/src/Extension/CoreExtension.php on line 768 |Array callback, mixed||string|int args = [], id = false, wrkarounds = false, mixed||string|int woptions = []) :
since |
1.7.0 |
---|
Arguments
- callback
callable
Callback or string shorthand for a callback- args
array<string|int, mixed>
Callback arguments- id
mixed
Cache ID- wrkarounds
bool
True to use workarounds- woptions
array<string|int, mixed>
Workaround options
Response
mixed
Result of the callback
getInstance
Returns a reference to a cache adapter object, always creating it
getInstance( type = 'output', mixed||string|int options = []) : \Joomla\CMS\Cache\CacheController
since |
1.7.0 |
---|---|
throws |
|
deprecated |
4.2 will be removed in 6.0 Use the cache controller factory instead Example: Factory::getContainer()->get(CacheControllerFactoryInterface::class)->createCacheController($type, $options); |
Arguments
- type
string
The cache object type to instantiate; default is output.- options
array<string|int, mixed>
Array of options
Response
store
Store data to cache by ID and group
store( data, id, group = null, wrkarounds = true) :
since |
4.0.0 |
---|
Arguments
- data
mixed
The data to store- id
string
The cache data ID- group
string
The cache data group- wrkarounds
bool
True to use wrkarounds
Response
bool
True if cache stored
Properties
options
Array of options
since |
1.7.0 |
---|
Type(s)
array<string|int, mixed>