| 1 |
<?php |
| 2 |
|
| 3 |
/** |
| 4 |
* Class LP_Settings_Cache |
| 5 |
* |
| 6 |
* @author tungnx |
| 7 |
* @since 4.2.2 |
| 8 |
* @version 1.0.0 |
| 9 |
*/ |
| 10 |
defined( 'ABSPATH' ) || exit(); |
| 11 |
|
| 12 |
class LP_Settings_Cache extends LP_Cache { |
| 13 |
/** |
| 14 |
* @var string key group |
| 15 |
*/ |
| 16 |
protected $key_group_child = 'settings'; |
| 17 |
/** |
| 18 |
* @var string key cache |
| 19 |
*/ |
| 20 |
public $key_settings = 'lp_settings'; |
| 21 |
|
| 22 |
public function __construct( $has_thim_cache = false ) { |
| 23 |
parent::__construct( $has_thim_cache ); |
| 24 |
} |
| 25 |
|
| 26 |
/** |
| 27 |
* Set cache lp settings. |
| 28 |
* |
| 29 |
* @param string $value |
| 30 |
* |
| 31 |
* @return void |
| 32 |
*/ |
| 33 |
public function set_lp_settings( string $value = '' ) { |
| 34 |
$key = "$this->key_settings"; |
| 35 |
$this->set_cache( $key, $value ); |
| 36 |
} |
| 37 |
|
| 38 |
/** |
| 39 |
* Get cache lp settings. |
| 40 |
* |
| 41 |
* @return array|false|mixed|string |
| 42 |
*/ |
| 43 |
public function get_lp_settings() { |
| 44 |
$key = $this->key_settings; |
| 45 |
return $this->get_cache( $key ); |
| 46 |
} |
| 47 |
|
| 48 |
/** |
| 49 |
* Clear cache lp settings. |
| 50 |
* |
| 51 |
* @return void |
| 52 |
*/ |
| 53 |
public function clean_lp_settings() { |
| 54 |
$key = $this->key_settings; |
| 55 |
$this->clear( $key ); |
| 56 |
} |
| 57 |
} |
| 58 |
|