With the code example from https://docs.espocrm.com/development/hooks/
=> tha gives me "PHP Parse error: syntax error, unexpected ':', expecting ';' or"..
So i changed the code from:
PHP Code:
public function beforeSave(Entity $entity, array $options): void
PHP Code:
public function beforeSave(Entity $entity, array $options)
PHP Fatal error: Call to undefined method Espo\Custom\Hooks\Connection\MyHook::getDependency List() in /data/webs/test_espocrm/webroot/application/Espo/Core/HookManager.php on line 128
My Hook looks like:
PHP Code:
<?php
namespace Espo\Custom\Hooks\Connection;
use Espo\ORM\Entity;
class MyHook
{
// optional parameter, defines in which order hooks will be processed
// less value means sooner
public static $order = 5;
public function beforeSave(Entity $entity, array $options)
{
}
}
?>I am using EspoCRM Version 5.5.6
Any hints?
Cheers,
Michael

Leave a comment: