Esempio n. 1
0
 /**
  * Add an RPC method
  *
  * @param \Comodojo\RpcServer\RpcMethod $method
  *
  * @return bool
  */
 public final function add(\Comodojo\RpcServer\RpcMethod $method)
 {
     $name = $method->getName();
     if (array_key_exists($name, $this->rpc_methods)) {
         $this->logger->warning("Cannot add method " . $name . ": duplicate entry");
         return false;
     } else {
         $this->rpc_methods[$name] = $method;
         $this->logger->info("Added method " . $name);
         return true;
     }
 }