Override VoipHelper

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mfonsatti
    Active Community Member
    • Jul 2018
    • 13

    Override VoipHelper

    Hi,
    is the a way to override a method in /Espo/Modules/Voip/Core/Helpers/Voip.php ?
    i'm trying to override the method findEntitiesByPhone because it makes a query that can't use index ... ( it search for '%phoneNumber' )

    Below the process i've done ...

    /Espo/Modules/xxx/Resources/metadata/app/loaders.json
    /Espo/Modules/xxx/Voip/Loaders/VoipHelper.php
    /Espo/Modules/xxx/Voip/VoipHelper.php

    1)Created the configuration file
    /Espo/Modules/xxx/Resources/metadata/app/loaders.json


    Code:
    { "VoipHelper": "\\Espo\\Modules\\xxx\\Voip\\Loaders\\VoipHelper" }

    2)Override the loader class
    /Espo/Modules/xxx/Voip/Loaders/VoipHelper.php

    PHP Code:
    namespace Espo\Modules\xxx\Voip\Loaders;
    
    class VoipHelper extends \Espo\Modules\Voip\Loaders\VoipHelper
    {
        public function load()
        {
            return new \Espo\Modules\xxx\Voip\VoipHelper;
        }
    } 
    


    3)Override the method findEntitiesByPhone
    /Espo/Modules/xxx/Voip/VoipHelper.php

    PHP Code:
    namespace Espo\Modules\xxx\Voip;
    
    class VoipHelper extends \Espo\Modules\Voip\Core\Helpers\Voip
    {
        /////
    
    } 
    


    Still not working ... what i'm doing wrong ?
    Last edited by tanya; 07-09-2018, 08:07 AM.
  • tanya
    Senior Member
    • Jun 2014
    • 4308

    #2
    override in custom\Espo\Custom\ folder
    like custom\Espo\Custom\Core\Loaders

    Comment


    • mfonsatti
      mfonsatti commented
      Editing a comment
      This approach not work , already tried , and i think that is not necessary because in point 1) and 2) we specify the class path ...
  • tanya
    Senior Member
    • Jun 2014
    • 4308

    #3
    check loaders in data/cache/application/metadata.php
    Last edited by tanya; 07-06-2018, 01:48 PM.

    Comment


    • mfonsatti
      mfonsatti commented
      Editing a comment
      Yeah !!! Loaders was cached ... thanks
Working...