| Total Complexity | 5 |
| Total Lines | 42 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 13 | class GridFieldStateManager implements GridFieldStateManagerInterface |
||
| 14 | { |
||
| 15 | /** |
||
| 16 | * @param GridField $gridField |
||
| 17 | * @return string |
||
| 18 | */ |
||
| 19 | public function getStateKey(GridField $gridField): string |
||
| 20 | { |
||
| 21 | $i = 0; |
||
| 22 | $form = $gridField->getForm(); |
||
| 23 | if ($form) { |
||
|
|
|||
| 24 | $controller = $form->getController(); |
||
| 25 | while ($controller instanceof GridFieldDetailForm_ItemRequest) { |
||
| 26 | $controller = $controller->getController(); |
||
| 27 | $i++; |
||
| 28 | } |
||
| 29 | } |
||
| 30 | |||
| 31 | return sprintf('%s-%s-%s', 'gridState', $gridField->getName(), $i); |
||
| 32 | } |
||
| 33 | |||
| 34 | /** |
||
| 35 | * @param GridField $gridField |
||
| 36 | * @param string $url |
||
| 37 | * @return string |
||
| 38 | */ |
||
| 39 | public function addStateToURL(GridField $gridField, string $url): string |
||
| 45 | } |
||
| 46 | |||
| 47 | /** |
||
| 48 | * @param GridField $gridField |
||
| 49 | * @param HTTPRequest $request |
||
| 50 | * @return string|null |
||
| 51 | */ |
||
| 52 | public function getStateFromRequest(GridField $gridField, HTTPRequest $request): ?string |
||
| 55 | } |
||
| 56 | } |
||
| 57 |