Announcement

Collapse
No announcement yet.

Hooks Sample Request

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Hooks Sample Request

    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






    Last edited by item; 12-16-2017, 12:18 PM.

  • #2
    class ContactName extends \Espo\Core\Hooks\Base

    Comment

    Working...
    X