Elgg  Version 3.0
ServiceFacade.php
Go to the documentation of this file.
1 <?php
2 
3 namespace Elgg\Di;
4 
8 trait ServiceFacade {
9 
14  abstract public static function name();
15 
20  public static function instance() {
21  $name = static::name();
22  return elgg()->$name;
23  }
24 
28  public static function call() {
29  $arguments = func_get_args();
30  $method = array_shift($arguments);
31 
32  return elgg()->call([self::instance(), $method], $arguments);
33  }
34 }
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
var elgg
Definition: elgglib.js:4