Function Self_learning_cache->append
Definitions
sources/caches.php
- Add something to a list entry in the cache. Uses keys to set the value, then assigns $value_2 to the key.This is efficient for duplication prevention.
- Visibility: public
- Is abstract?: No
- Is static?: No
- Is final?: No
- Returns: bool
Parameters
| Name | Type | Passed by reference? | Variadic? | Default | Set | Range | Description |
|---|---|---|---|---|---|---|---|
| $key | ID_TEXT | No | No | required parameter | N/A | N/A | Cache key |
| $value | mixed | No | No | required parameter | N/A | N/A | Value to append (must not be an object or array, so you may need to pre-serialize) |
| $value_2 | mixed | No | No | True | N/A | N/A | Secondary value to attach to appended value (optional) |
Returns
- Whether the value was appended (false if it was already there)
- Type: boolean
- Set: N/A
- Range: N/A
Preview
Code (PHP)
/**
* Add something to a list entry in the cache. Uses keys to set the value, then assigns $value_2 to the key.This is efficient for duplication prevention.
*
* @param ID_TEXT $key Cache key
* @param mixed $value Value to append (must not be an object or array, so you may need to pre-serialize)
* @param mixed $value_2 Secondary value to attach to appended value (optional)
* @return boolean Whether the value was appended (false if it was already there)
*/
public function append(string $key, $value, $value_2 = true) : bool
* Add something to a list entry in the cache. Uses keys to set the value, then assigns $value_2 to the key.This is efficient for duplication prevention.
*
* @param ID_TEXT $key Cache key
* @param mixed $value Value to append (must not be an object or array, so you may need to pre-serialize)
* @param mixed $value_2 Secondary value to attach to appended value (optional)
* @return boolean Whether the value was appended (false if it was already there)
*/
public function append(string $key, $value, $value_2 = true) : bool

