How to create a service instance from a static function ?

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

    #1

    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
    EspoCRM product developer
    • Mar 2014
    • 9617

    #2
    Not possible. There is no any global variable in espocrm.

    Comment

    • tothewine
      Active Community Member
      • Jan 2018
      • 411

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

      Comment

      Working...