How to create a service instance from a static function ?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tothewine
    Active Community Member
    • Jan 2018
    • 373

    How to create a service instance from a static function ?

    I want to do this in a static function. Is there any way to get a reference from the global $app variable for example ?
    PHP Code:
      $activityService = $this->getServiceFactory()->create('Activities'); 
    
  • yuri
    Member
    • Mar 2014
    • 8440

    #2
    Not possible. There is no any global variable in espocrm.
    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

    • tothewine
      Active Community Member
      • Jan 2018
      • 373

      #3
      There is no way to get a ServiceFactory from $GLOBALS['app'] ?

      Comment

      Working...