Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | n/a |
0 / 0 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
|||
| 1 | <?php |
| 2 | /** |
| 3 | * Jingga |
| 4 | * |
| 5 | * PHP Version 8.1 |
| 6 | * |
| 7 | * @package phpOMS\DataStorage |
| 8 | * @copyright Dennis Eichhorn |
| 9 | * @license OMS License 2.0 |
| 10 | * @version 1.0.0 |
| 11 | * @link https://jingga.app |
| 12 | */ |
| 13 | declare(strict_types=1); |
| 14 | |
| 15 | namespace phpOMS\DataStorage; |
| 16 | |
| 17 | /** |
| 18 | * Datamapper interface. |
| 19 | * |
| 20 | * DB, Cache, Session |
| 21 | * |
| 22 | * @package phpOMS\DataStorage |
| 23 | * @license OMS License 2.0 |
| 24 | * @link https://jingga.app |
| 25 | * @since 1.0.0 |
| 26 | */ |
| 27 | interface DataStoragePoolInterface |
| 28 | { |
| 29 | /** |
| 30 | * Add connection. |
| 31 | * |
| 32 | * @param string $key Connection key |
| 33 | * @param DataStorageConnectionInterface $db Connection |
| 34 | * |
| 35 | * @return bool |
| 36 | * |
| 37 | * @since 1.0.0 |
| 38 | */ |
| 39 | public function add(string $key, DataStorageConnectionInterface $db) : bool; |
| 40 | |
| 41 | /** |
| 42 | * Get connection. |
| 43 | * |
| 44 | * @param string $key Connection key |
| 45 | * |
| 46 | * @return DataStorageConnectionInterface |
| 47 | * |
| 48 | * @since 1.0.0 |
| 49 | */ |
| 50 | public function get(string $key = '') : DataStorageConnectionInterface; |
| 51 | |
| 52 | /** |
| 53 | * Remove connection. |
| 54 | * |
| 55 | * @param string $key Connection key |
| 56 | * |
| 57 | * @return bool |
| 58 | * |
| 59 | * @since 1.0.0 |
| 60 | */ |
| 61 | public function remove(string $key) : bool; |
| 62 | |
| 63 | /** |
| 64 | * Create connection. |
| 65 | * |
| 66 | * @param string $key Connection key |
| 67 | * @param array $config Connection config data |
| 68 | * |
| 69 | * @return bool |
| 70 | * |
| 71 | * @since 1.0.0 |
| 72 | */ |
| 73 | public function create(string $key, array $config) : bool; |
| 74 | } |