From a793b16439bc906c6c26cfd5d31e9bd5c86c547c Mon Sep 17 00:00:00 2001 From: PululuK Date: Wed, 6 Dec 2023 18:06:42 +0100 Subject: [PATCH] Add new hook in object presenter --- install-dev/data/xml/hook.xml | 5 +++++ src/Adapter/Presenter/Object/ObjectPresenter.php | 2 ++ 2 files changed, 7 insertions(+) diff --git a/install-dev/data/xml/hook.xml b/install-dev/data/xml/hook.xml index 7301372df2545..8134f5c6a19b1 100644 --- a/install-dev/data/xml/hook.xml +++ b/install-dev/data/xml/hook.xml @@ -4539,5 +4539,10 @@ Triggers after loading routes Allow modules to modify routes in any way or add their own multilanguage routes. + + actionPresentObject + Object Presenter + This hook is called before a object is presented + diff --git a/src/Adapter/Presenter/Object/ObjectPresenter.php b/src/Adapter/Presenter/Object/ObjectPresenter.php index a17536b177b5f..eafd7a2276ebd 100644 --- a/src/Adapter/Presenter/Object/ObjectPresenter.php +++ b/src/Adapter/Presenter/Object/ObjectPresenter.php @@ -55,6 +55,8 @@ public function present($object) $presentedObject['id'] = $object->id; + Hook::exec('actionPresentObject', ['presentedObject' => &$presentedObject, 'table' => $object::$definition['table']]); + $this->filterHtmlContent($object::$definition['table'], $presentedObject, $object->getHtmlFields()); return $presentedObject;