Hi,
I have follow all "doc/forum/google" about a simple "hook" for a Entity.
I have created file at : custom/Espo/Custom/Hooks/Contact/ContactName.php
with this
<?php
namespace Espo\Custom\Hooks\Contact;
use Espo\ORM\Entity;
class ContactName extends Espo\Core\Hooks\Base
{
public function beforeSave(Entity $entity, array $options = array())
{
$entity->set("lastName",strtoupper( $entity->get('lastName')) );
}
}
?>
do a clear cache
logoff, login..
And never hook fire.
What I have wrong ?
Error : PHP Fatal error: Class 'Espo\Custom\Hooks\Contact\Espo\Core\Hooks\Base' not found in /Applications/MAMP/htdocs/custom/Espo/Custom/Hooks/Contact/ContactName.php on line 6
Thanks
I have follow all "doc/forum/google" about a simple "hook" for a Entity.
I have created file at : custom/Espo/Custom/Hooks/Contact/ContactName.php
with this
<?php
namespace Espo\Custom\Hooks\Contact;
use Espo\ORM\Entity;
class ContactName extends Espo\Core\Hooks\Base
{
public function beforeSave(Entity $entity, array $options = array())
{
$entity->set("lastName",strtoupper( $entity->get('lastName')) );
}
}
?>
do a clear cache
logoff, login..
And never hook fire.
What I have wrong ?
Error : PHP Fatal error: Class 'Espo\Custom\Hooks\Contact\Espo\Core\Hooks\Base' not found in /Applications/MAMP/htdocs/custom/Espo/Custom/Hooks/Contact/ContactName.php on line 6
Thanks
Comment