ObjectCache
extends CallbackCache
in package
Table of Contents
- $options : PatternOptions
- __call() : mixed
- Class method call handler
- __get() : mixed
- Reading data from properties.
- __invoke() : mixed
- Handle invoke calls
- __isset() : bool
- Checking existing properties.
- __set() : void
- Writing data to properties.
- __toString() : string
- Handle casting to string
- __unset() : void
- Unseting a property.
- call() : mixed
- Call and cache a class method
- generateKey() : string
- Generate a unique key in base of a key representing the callback part and a key representing the arguments part.
- getOptions() : PatternOptions
- Get all pattern options
- setOptions() : void
- Set options
- generateArgumentsKey() : string
- Generate a unique key of the argument part.
- generateCallbackKey() : string
- Generate a unique key in base of a key representing the callback part and a key representing the arguments part.
Properties
$options
protected
PatternOptions
$options
Methods
__call()
Class method call handler
public
__call(string $method, array<string|int, mixed> $args) : mixed
Parameters
- $method : string
-
Method name to call
- $args : array<string|int, mixed>
-
Method arguments
Tags
Return values
mixed —__get()
Reading data from properties.
public
__get(string $name) : mixed
NOTE: Magic properties will be cached too if the option cacheMagicProperties is enabled and the property doesn't exist in real. If so it calls __get.
Parameters
- $name : string
Tags
Return values
mixed —__invoke()
Handle invoke calls
public
__invoke() : mixed
Tags
Return values
mixed —__isset()
Checking existing properties.
public
__isset(string $name) : bool
NOTE: Magic properties will be cached too if the option cacheMagicProperties is enabled and the property doesn't exist in real. If so it calls __get.
Parameters
- $name : string
Tags
Return values
bool —__set()
Writing data to properties.
public
__set(string $name, mixed $value) : void
NOTE: Magic properties will be cached too if the option cacheMagicProperties is enabled and the property doesn't exist in real. If so it calls __set and removes cached data of previous __get and __isset calls.
Parameters
- $name : string
- $value : mixed
Tags
Return values
void —__toString()
Handle casting to string
public
__toString() : string
Tags
Return values
string —__unset()
Unseting a property.
public
__unset(string $name) : void
NOTE: Magic properties will be cached too if the option cacheMagicProperties is enabled and the property doesn't exist in real. If so it removes previous cached __isset and __get calls.
Parameters
- $name : string
Tags
Return values
void —call()
Call and cache a class method
public
call(string $method[, array<string|int, mixed> $args = [] ]) : mixed
Parameters
- $method : string
-
Method name to call
- $args : array<string|int, mixed> = []
-
Method arguments
Tags
Return values
mixed —generateKey()
Generate a unique key in base of a key representing the callback part and a key representing the arguments part.
public
generateKey(string $method[, array<string|int, mixed> $args = [] ]) : string
Parameters
- $method : string
-
The method
- $args : array<string|int, mixed> = []
-
Callback arguments
Tags
Return values
string —getOptions()
Get all pattern options
public
getOptions() : PatternOptions
Return values
PatternOptions —setOptions()
Set options
public
setOptions(PatternOptions $options) : void
Parameters
- $options : PatternOptions
Tags
Return values
void —generateArgumentsKey()
Generate a unique key of the argument part.
protected
generateArgumentsKey(array<string|int, mixed> $args) : string
Parameters
- $args : array<string|int, mixed>
Tags
Return values
string —generateCallbackKey()
Generate a unique key in base of a key representing the callback part and a key representing the arguments part.
protected
generateCallbackKey(callable $callback[, array<string|int, mixed> $args = [] ]) : string
Parameters
- $callback : callable
-
A valid callback
- $args : array<string|int, mixed> = []
-
Callback arguments