| 1 |
<?php |
| 2 |
|
| 3 |
namespace OptimoleWP\PageProfiler\Storage; |
| 4 |
|
| 5 |
/** |
| 6 |
* Abstract base class for storage implementations. |
| 7 |
* |
| 8 |
* This class defines the interface for storage operations that concrete |
| 9 |
* implementations must provide. |
| 10 |
*/ |
| 11 |
abstract class Base { |
| 12 |
|
| 13 |
/** |
| 14 |
* Store data with the given key. |
| 15 |
* |
| 16 |
* @param string $key The unique identifier for the data. |
| 17 |
* @param array $data The data to store. |
| 18 |
*/ |
| 19 |
abstract public function store( string $key, array $data ); |
| 20 |
|
| 21 |
/** |
| 22 |
* Retrieve data by key. |
| 23 |
* |
| 24 |
* @param string $key The unique identifier for the data to retrieve. |
| 25 |
* @return array|false The stored data or null if not found. |
| 26 |
*/ |
| 27 |
abstract public function get( string $key ); |
| 28 |
|
| 29 |
/** |
| 30 |
* Delete data by key. |
| 31 |
* |
| 32 |
* @param string $key The unique identifier for the data to delete. |
| 33 |
*/ |
| 34 |
abstract public function delete( string $key ); |
| 35 |
|
| 36 |
/** |
| 37 |
* Delete all stored data. |
| 38 |
*/ |
| 39 |
abstract public function delete_all(); |
| 40 |
} |
| 41 |
|