Elgg  Version master
ServiceFacade.php
Go to the documentation of this file.
1 <?php
2 
3 namespace Elgg\Traits\Di;
4 
8 trait ServiceFacade {
9 
15  abstract public static function name();
16 
22  public static function instance() {
23  $name = static::name();
24 
25  return elgg()->$name;
26  }
27 
33  public static function call() {
34  $arguments = func_get_args();
35  $method = array_shift($arguments);
36 
37  return elgg()->call([self::instance(), $method], $arguments);
38  }
39 }
elgg
Definition: install.js:27
if(!$user||!$user->canDelete()) $name
Definition: delete.php:22
trait ServiceFacade
Utility trait that can be used by public services to provide better IDE support and type-hinting...
$site name
Definition: settings.php:15