diff options
Diffstat (limited to 'src/controller/PageManagementController.php')
| -rw-r--r-- | src/controller/PageManagementController.php | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/controller/PageManagementController.php b/src/controller/PageManagementController.php index 2cc88a5..8efcb79 100644 --- a/src/controller/PageManagementController.php +++ b/src/controller/PageManagementController.php | |||
| @@ -334,4 +334,21 @@ class PageManagementController | |||
| 334 | } | 334 | } |
| 335 | die; | 335 | die; |
| 336 | } | 336 | } |
| 337 | static public function changePaginationLimit(EntityManager $entityManager, array $json): void | ||
| 338 | { | ||
| 339 | if(isset($json['id']) && isset($json['pagination_limit'])){ | ||
| 340 | $director = new Director($entityManager); | ||
| 341 | $director->findNodeById($json['id']); | ||
| 342 | $old_limit = $director->getNode()->getNodeData()->getPaginationLimit() ?? 12; | ||
| 343 | $director->getNode()->getNodeData()->setPaginationLimit((int)$json['pagination_limit']); // attention conversion? | ||
| 344 | |||
| 345 | $entityManager->flush(); | ||
| 346 | |||
| 347 | echo json_encode(['success' => true, 'old_limit' => $old_limit, 'new_limit' => $json['pagination_limit']]); | ||
| 348 | } | ||
| 349 | else{ | ||
| 350 | echo json_encode(['success' => false]); | ||
| 351 | } | ||
| 352 | die; | ||
| 353 | } | ||
| 337 | } \ No newline at end of file | 354 | } \ No newline at end of file |
