injectableFactory->create() is not affected by custom binding

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • a.slyzhko
    Member
    • Oct 2023
    • 95

    injectableFactory->create() is not affected by custom binding

    Hi there!

    I have a problem. I have created custom binding. But it has no affect. I am trying to bind custom ApplierClassNameListProvider. For example in Espo\Core\Record\Service.php there is a function
    PHP Code:
    private function createSelectApplierClassNameListProvider(): ApplierClassNameListProvider
    {
        return $this->injectableFactory->create(ApplierClassNameListProvider::class);
    }
    And it instantiates ApplierClassNameListProvider directly
  • yuri
    Member
    • Mar 2014
    • 8483

    #2
    Hi,

    You can't override what is created using create method. It's not supposed to be possible to override anything.
    Last edited by yuri; 03-21-2024, 02:37 PM.
    If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

    Comment

    • a.slyzhko
      Member
      • Oct 2023
      • 95

      #3
      So there is now way to apply selectApplierClassNameList globally?

      Comment

      • yuri
        Member
        • Mar 2014
        • 8483

        #4
        No. Though you can add it for new custom entities using entity manager hooks. https://docs.espocrm.com/development...ntity-manager/
        If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

        Comment

        Working...