Function __global->get_value_newer_than
Definitions
sources/config.php
- Find the specified configuration option if it is younger than a specified time.
- Visibility: public
- Is abstract?: No
- Is static?: No
- Is final?: No
- Returns: string
Parameters
| Name | Type | Passed by reference? | Variadic? | Default | Set | Range | Description |
|---|---|---|---|---|---|---|---|
| $name | ID_TEXT | No | No | required parameter | N/A | N/A | The name of the value |
| $cutoff | TIME | No | No | required parameter | N/A | N/A | The cutoff time (an absolute time, not a relative "time ago") |
| $elective_or_lengthy | boolean | No | No | False | N/A | N/A | Whether this value is an elective/lengthy one. Use this for getting & setting if you don't want it to be loaded up in advance for every page view (in bulk alongside other values), or if the value may be more than 255 characters. Performance trade-off: frequently used values should not be elective, infrequently used values should be elective. |
Returns
- The value (null: value newer than not found)
- Type: ?SHORT_TEXT
- Set: N/A
- Range: N/A
Preview
Code (PHP)
/**
* Find the specified configuration option if it is younger than a specified time.
*
* @param ID_TEXT $name The name of the value
* @param TIME $cutoff The cutoff time (an absolute time, not a relative "time ago")
* @param boolean $elective_or_lengthy Whether this value is an elective/lengthy one. Use this for getting & setting if you don't want it to be loaded up in advance for every page view (in bulk alongside other values), or if the value may be more than 255 characters. Performance trade-off: frequently used values should not be elective, infrequently used values should be elective.
* @return ?SHORT_TEXT The value (null: value newer than not found)
*/
function get_value_newer_than(string $name, int $cutoff, bool $elective_or_lengthy = false) : ?string
* Find the specified configuration option if it is younger than a specified time.
*
* @param ID_TEXT $name The name of the value
* @param TIME $cutoff The cutoff time (an absolute time, not a relative "time ago")
* @param boolean $elective_or_lengthy Whether this value is an elective/lengthy one. Use this for getting & setting if you don't want it to be loaded up in advance for every page view (in bulk alongside other values), or if the value may be more than 255 characters. Performance trade-off: frequently used values should not be elective, infrequently used values should be elective.
* @return ?SHORT_TEXT The value (null: value newer than not found)
*/
function get_value_newer_than(string $name, int $cutoff, bool $elective_or_lengthy = false) : ?string
