| 1 | <?php |
||
| 9 | class SessionHelper { |
||
| 10 | |||
| 11 | const SESSION_STORAGE = 'data-tables.'; |
||
| 12 | |||
| 13 | /** |
||
| 14 | * Save the state for the given key. |
||
| 15 | * |
||
| 16 | * @param string $key |
||
| 17 | * @param mixed $sessionValue |
||
| 18 | */ |
||
| 19 | 2 | public function saveState(string $key, $sessionValue) : void |
|
| 23 | |||
| 24 | /** |
||
| 25 | * @param string $key |
||
| 26 | * @return string |
||
| 27 | */ |
||
| 28 | 3 | private function _getFormattedKey(string $key) : string |
|
| 39 | |||
| 40 | /** |
||
| 41 | * Get the state for the given key. |
||
| 42 | * |
||
| 43 | * @param string $key |
||
| 44 | * @param null $default |
||
| 45 | * @return mixed |
||
| 46 | */ |
||
| 47 | 3 | public function getState(string $key, $default = null) |
|
| 51 | |||
| 52 | /** |
||
| 53 | * Remove the state for the given key. |
||
| 54 | * |
||
| 55 | * @param string $key |
||
| 56 | */ |
||
| 57 | 1 | public function removeState(string $key) : void |
|
| 61 | } |