Skip to content

Commit

Permalink
Add new hook in object presenter
Browse files Browse the repository at this point in the history
  • Loading branch information
PululuK committed Dec 6, 2023
1 parent 55e08e9 commit a793b16
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions install-dev/data/xml/hook.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4539,5 +4539,10 @@
<title>Triggers after loading routes</title>
<description>Allow modules to modify routes in any way or add their own multilanguage routes.</description>
</hook>
<hook id="actionPresentObject">
<name>actionPresentObject</name>
<title>Object Presenter</title>
<description>This hook is called before a object is presented</description>
</hook>
</entities>
</entity_hook>
2 changes: 2 additions & 0 deletions src/Adapter/Presenter/Object/ObjectPresenter.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit a793b16

Please sign in to comment.