From f6b9e4a0549c397a1a700b5a7bb6d858e8ed3b95 Mon Sep 17 00:00:00 2001 From: Jan Kristinus Date: Thu, 2 Nov 2023 00:29:49 +0100 Subject: [PATCH] =?UTF-8?q?rest=20route=20getItemFunc=20bei=20mehrenen=20I?= =?UTF-8?q?nstanzen=20erg=C3=A4nzt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/rest/lib/rest/route.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/plugins/rest/lib/rest/route.php b/plugins/rest/lib/rest/route.php index 227e164d..2e657f0e 100644 --- a/plugins/rest/lib/rest/route.php +++ b/plugins/rest/lib/rest/route.php @@ -221,10 +221,15 @@ public function handleRequest(array $paths, array $get) $data = []; if ($instances) { foreach ($instances as $instance) { - $data[] = $this->getInstanceData( + $instance_data = $this->getInstanceData( $instance, array_merge($paths, [$instance->getId()]) ); + if (is_callable($this->getItemFunc)) { + $instance_data = call_user_func($this->getItemFunc, $this, $instance_data); + } + + $data[] = $instance_data; } if ($baseInstances) { $links = [];