81 if (count($this->providers)) {
82 $ret = reset($this->providers)->getMode();
97 public function register($object)
100 $contract =
'\Xoops\Core\Service\Contract\\' . $this->
service .
'Interface';
102 if (is_a($object,
'\Xoops\Core\Service\AbstractContract')
103 && $object instanceof $contract
105 $this->providers[] = $object;
127 $s = usort($sortable,
function ($a, $b) {
128 if ($a->getPriority() != $b->getPriority()) {
129 return ($a->getPriority() > $b->getPriority()) ? 1 : -1;
134 $this->providers = $sortable;
164 $object = reset($this->providers);
165 $method = array($object,
$name);
167 if (is_callable($method)) {
171 call_user_func_array($method, $arguments);
172 }
catch (\Exception $e) {
174 $response->setSuccess(
false)->addErrorMessage($e->getMessage());
177 $response->setSuccess(
false)->addErrorMessage(sprintf(
'No method %s',
$name));
__construct(Manager $manager, $service)
__call($name, $arguments)
if($xoops->isUser()&&$isAdmin) $response
static __callStatic($name, $arguments)