Lines Matching defs:key
82 * public function get(string $key, mixed $default = null): mixed;
85 * @param string $key The unique key of this item in the cache.
86 * @param mixed $default Default value to return if the key does not exist.
91 * MUST be thrown if the $key string is not a legal value.
93 public function get_data(string $key, $default = null)
95 $data = $this->cache->get($key, $default);
105 * Persists data in the cache, uniquely referenced by a key with an optional expiration TTL time.
109 * public function set(string $key, mixed $value, null|int|\DateInterval $ttl = null): bool;
112 * @param string $key The key of the item to store.
121 * MUST be thrown if the $key string is not a legal value.
123 public function set_data(string $key, array $value, ?int $ttl = null): bool
125 return $this->cache->set($key, $value, $ttl);
129 * Delete an item from the cache by its unique key.
133 * public function delete(string $key): bool;
136 * @param string $key The unique cache key of the item to delete.
141 * MUST be thrown if the $key string is not a legal value.
143 public function delete_data(string $key): bool
145 return $this->cache->delete($key);