Announcement

Collapse
No announcement yet.

Overriding processActionHistoryRecord method of \Espo\Services\Record

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

  • Overriding processActionHistoryRecord method of \Espo\Services\Record

    I would like to override that method but extending the class like this does not seem to work when putting the file in custom/Espo/Custom/Services/Record.php

    Code:
    namespace Espo\Custom\Services;
    use Espo\ORM\Entity;
    
    class Record extends \Espo\Services\Record
    {
        protected function processActionHistoryRecord($action, Entity $entity): void {
            if ($this->getUser()->get('name') !== 'security_auditor') {
                parent::processActionHistoryRecord($action, $entity);
            }
        }
    }
    Last edited by tothewine; 01-27-2020, 09:40 PM.

  • #2
    Looks like the problem is the core class is inherited instead of the custom one.
    Last edited by tothewine; 02-02-2020, 11:38 AM.

    Comment


    • #3
      Hello, did you solve this? I'm also currently looking in extending the Account service class but the custom service is not the one that's being loaded.

      Comment


      • tothewine
        tothewine commented
        Editing a comment
        Not really... I think you need to figure out what the actual class being used and override that instead.
    Working...
    X