From 088df7c352ddd3d60e1191e4a8f098b6fdc51bad Mon Sep 17 00:00:00 2001 From: silverbackdan Date: Tue, 20 Aug 2024 14:15:49 +0100 Subject: [PATCH] Adjust admin associated resource data for route --- src/Entity/Core/Route.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Entity/Core/Route.php b/src/Entity/Core/Route.php index 4ad90429..fd6d5c0d 100644 --- a/src/Entity/Core/Route.php +++ b/src/Entity/Core/Route.php @@ -202,8 +202,13 @@ public function setPageData(?AbstractPageData $pageData): self } #[Groups(['Route:cwa_resource:read:ROLE_ADMIN'])] - public function getAssociatedResource() + public function getAssociatedResources() { - return $this->redirect ?: $this->pageData ?: $this->page; + return [ + 'redirect' => $this->redirect?->path, + 'page' => $this->page?->reference, + 'pageData' => $this->pageData?->getTitle(), + 'pageDataType' => $this->pageData ? get_class($this->pageData) : null + ]; } }