| 1 |
<?php |
| 2 |
|
| 3 |
namespace Dev4Press\Plugin\SweepPress\Base; |
| 4 |
|
| 5 |
use Dev4Press\Plugin\SweepPress\Basic\Cache; |
| 6 |
|
| 7 |
if ( ! defined( 'ABSPATH' ) ) { |
| 8 |
exit; |
| 9 |
} |
| 10 |
|
| 11 |
abstract class Query { |
| 12 |
protected $_group = ''; |
| 13 |
|
| 14 |
public function __construct() { |
| 15 |
|
| 16 |
} |
| 17 |
|
| 18 |
protected function retrieve( string $name ) { |
| 19 |
return Cache::instance()->get( $this->_group, $name ); |
| 20 |
} |
| 21 |
|
| 22 |
protected function store( string $name, array $data ) { |
| 23 |
Cache::instance()->add( $this->_group, $name, $data ); |
| 24 |
} |
| 25 |
|
| 26 |
protected function clear( string $name ) { |
| 27 |
Cache::instance()->delete( $this->_group, $name ); |
| 28 |
} |
| 29 |
} |
| 30 |
|