| [ Index ] |
PHP Cross Reference of WordPress Trunk (Updated Daily) |
[Source view] [Print] [Project Stats]
WP AI Client: WP_AI_Client_Cache class
| File Size: | 238 lines (7 kb) |
| Included or required: | 0 times |
| Referenced: | 0 times |
| Includes or requires: | 0 files |
WP_AI_Client_Cache:: (11 methods):
get_cache_group()
get()
set()
delete()
clear()
getMultiple()
setMultiple()
deleteMultiple()
has()
ttl_to_seconds()
iterable_to_array()
Class: WP_AI_Client_Cache - X-Ref
WordPress-specific PSR-16 cache adapter for the AI Client.| get_cache_group() X-Ref |
| Retrieves the cache group used for cache operations, applying a filter for customization. return: string Cache group name. |
| get( $key, $default_value = null ) X-Ref |
| Fetches a value from the cache. param: string $key The unique key of this item in the cache. param: mixed $default_value Default value to return if the key does not exist. return: mixed The value of the item from the cache, or $default_value in case of cache miss. |
| set( $key, $value, $ttl = null ) X-Ref |
| Persists data in the cache, uniquely referenced by a key with an optional expiration TTL time. param: string $key The key of the item to store. param: mixed $value The value of the item to store, must be serializable. param: null|int|DateInterval $ttl Optional. The TTL value of this item. return: bool True on success and false on failure. |
| delete( $key ) X-Ref |
| Delete an item from the cache by its unique key. param: string $key The unique cache key of the item to delete. return: bool True if the item was successfully removed. False if there was an error. |
| clear() X-Ref |
| Wipes clean the entire cache's keys. This method only clears the cache group used by this adapter. If the underlying cache implementation does not support group flushing, this method returns false. return: bool True on success and false on failure. |
| getMultiple( $keys, $default_value = null ) X-Ref |
| Obtains multiple cache items by their unique keys. param: iterable<string> $keys A list of keys that can be obtained in a single operation. param: mixed $default_value Default value to return for keys that do not exist. return: array<string, mixed> A list of key => value pairs. |
| setMultiple( $values, $ttl = null ) X-Ref |
| Persists a set of key => value pairs in the cache, with an optional TTL. param: iterable<string, mixed> $values A list of key => value pairs for a multiple-set operation. param: null|int|DateInterval $ttl Optional. The TTL value of this item. return: bool True on success and false on failure. |
| deleteMultiple( $keys ) X-Ref |
| Deletes multiple cache items in a single operation. param: iterable<string> $keys A list of string-based keys to be deleted. return: bool True if the items were successfully removed. False if there was an error. |
| has( $key ) X-Ref |
| Determines whether an item is present in the cache. param: string $key The cache item key. return: bool True if the item exists in the cache, false otherwise. |
| ttl_to_seconds( $ttl ) X-Ref |
| Converts a PSR-16 TTL value to seconds for WordPress cache functions. param: null|int|DateInterval $ttl The TTL value. return: int The TTL in seconds, or 0 for no expiration. |
| iterable_to_array( $items ) X-Ref |
| Converts an iterable to an array. param: iterable<mixed> $items The iterable to convert. return: array<mixed> The array. |
| Generated : Fri Jul 24 08:20:19 2026 | Cross-referenced by PHPXref |