Announcement

Collapse
No announcement yet.

Override VoipHelper

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

  • 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.

  • #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 ...

  • #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...
X