Func
Less than 1 minute
Func
Class Func.
This class extends the Cache class and provides functionality to cache function calls.
Methods
__construct
public __construct({Array})
Parameters
Parameter | Type | Description |
---|---|---|
$backend | string | |
$options | Map |
call
Calls a function with the provided arguments and caches the result based on the configuration.
public call({Array})
This method retrieves the function name and its arguments, generates a cache key, and checks whether the function result should be cached based on the options provided. If caching is enabled and the result is found in the cache, it returns the cached result. Otherwise, it calls the function, caches the result, and then returns it.
generateKey
Generates a unique key string for a given function and its arguments.
private generateKey({Array})
Parameters
Parameter | Type | Description |
---|---|---|
$function | string | The function to generate a key for. Can be a string representing the function name |
or an array with the object and method name. |
| $paramArray
| array
| the array of parameters to be passed to the function |
Generated by Hazaar API Doc Generator