ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
All Data Structures Namespaces Files Functions Variables Modules Pages
XML_RPC2_Server_Callhandler_Instance Class Reference
+ Inheritance diagram for XML_RPC2_Server_Callhandler_Instance:
+ Collaboration diagram for XML_RPC2_Server_Callhandler_Instance:

Public Member Functions

 __construct ($instance, $defaultPrefix)
 XML_RPC2_Server_Callhandler_Class Constructor. More...
 
 __call ($methodName, $parameters)
 __call catchall. More...
 
- Public Member Functions inherited from XML_RPC2_Server_CallHandler
 getMethods ()
 methods getter More...
 
 getMethod ($name)
 method getter More...
 

Private Attributes

 $_instance
 

Additional Inherited Members

- Protected Member Functions inherited from XML_RPC2_Server_CallHandler
 addMethod (XML_RPC2_Server_Method $method)
 method appender More...
 
- Protected Attributes inherited from XML_RPC2_Server_CallHandler
 $methods = array()
 

Detailed Description

Definition at line 88 of file Instance.php.

Constructor & Destructor Documentation

◆ __construct()

XML_RPC2_Server_Callhandler_Instance::__construct (   $instance,
  $defaultPrefix 
)

XML_RPC2_Server_Callhandler_Class Constructor.

Creates a new call handler exporting the given object methods

Before using this constructor, take a look at XML_RPC2_Server::create. The factory method is usually a quicker way of instantiating the server and its call handler.

See also
XML_RPC2_Server::create()
Parameters
objectThe Target object. Calls will be made on this instance
stringDefault prefix to prepend to all exported methods (defaults to '')

Definition at line 113 of file Instance.php.

References XML_RPC2_Server_CallHandler\addMethod().

114  {
115  $this->_instance = $instance;
116  $reflection = new ReflectionClass(get_class($instance));
117  foreach ($reflection->getMethods() as $method) {
118  if (!$method->isStatic() && $method->isPublic() && !$method->isConstructor())
119  {
120  $candidate = new XML_RPC2_Server_Method($method, $defaultPrefix);
121  if (!$candidate->isHidden()) $this->addMethod($candidate);
122  }
123  }
124  }
addMethod(XML_RPC2_Server_Method $method)
method appender
+ Here is the call graph for this function:

Member Function Documentation

◆ __call()

XML_RPC2_Server_Callhandler_Instance::__call (   $methodName,
  $parameters 
)

__call catchall.

Delegate the method call to the target object, and return its result

Parameters
stringName of method to call
arrayArray of parameters for call
Returns
mixed Whatever the target method returned

Definition at line 136 of file Instance.php.

References XML_RPC2_Server_CallHandler\getMethod(), and XML_RPC2_Server_CallHandler\getMethods().

137  {
138  if (!array_key_exists($methodName, $this->getMethods())) {
139  throw new XML_RPC2_UnknownMethodException("Method $methodName is not exported by this server");
140  }
141  return call_user_func_array(array($this->_instance, $this->getMethod($methodName)->getInternalMethod()), $parameters);
142  }
getMethod($name)
method getter
getMethods()
methods getter
Definition: CallHandler.php:90
+ Here is the call graph for this function:

Field Documentation

◆ $_instance

XML_RPC2_Server_Callhandler_Instance::$_instance
private

Definition at line 98 of file Instance.php.


The documentation for this class was generated from the following file: