PRADO Component Framework for PHP 5
  • Home
  • About
  • Testimonials
  • Demos
  • Download
  • Documentation
  • Forum
  • Development
  • Tutorials
  • Class Docs
  • API Manual
  • Wiki

Packages

  • None
  • System
    • Caching
    • Collections
    • Data
      • ActiveRecord
        • Relations
        • Scaffold
          • InputBuilder
      • Commom
        • Sqlite
      • Common
        • Mssql
        • Mysql
        • Oracle
        • Pgsql
        • Sqlite
      • DataGateway
      • SqlMap
        • Configuration
        • Statements
    • Exceptions
    • I18N
    • IO
    • Security
    • Util
    • Web
      • Javascripts
      • Services
      • UI
        • ActiveControls
        • WebControls
    • Xml
  • Wsat
    • pages
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated
  • Todo

Class TRpcApiProvider

TRpcApiProvider class

TRpcApiProvider is an abstract class the can be subclasses in order to implement an api for a TRpcService. A subclass of TRpcApiProvider must implement the TRpcApiProvider::registerMethods() method in order to declare the available methods, their names and the associated callback.

public function registerMethods()
{
  return array(
    'apiMethodName1' => array('method' => array($this, 'objectMethodName1')),
    'apiMethodName2' => array('method' => array('ClassName', 'staticMethodName')),
  );
}

In this example, two api method have been defined. The first refers to an object method that must be implemented in the same class, the second to a static method implemented in a 'ClassName' class. In both cases, the method implementation will receive the request parameters as its method parameters. Since the number of received parameters depends on external-supplied data, it's adviced to use php's func_get_args() funtion to validate them.

Providers must be registered in the service configuration in order to be available, as explained in TRpcService's documentation.

TComponent
Extended by TApplicationComponent
Extended by TModule implements IModule
Extended by TRpcApiProvider
Abstract
Package: System\Web\Services
Copyright: 2010 Bigpoint GmbH
License: http://www.pradosoft.com/license/
Author: Robin J. Rogge <rrogge@bigpoint.net>
Version: $Id$
Since: 3.2
Located at Web/Services/TRpcService.php
Methods summary
abstract public
# registerMethods( )

Must return an array of the available methods

Must return an array of the available methods

public
# __construct( TRpcServer $rpcServer )

Constructor: informs the rpc server of the registered methods

Constructor: informs the rpc server of the registered methods

Overrides

TComponent::__construct()
public processed
# processRequest( )

Processes the request using the server

Processes the request using the server

Returns

processed
request
public rpc
# getRpcServer( )

Returns

rpc
server instance
Methods inherited from TModule
getID(), init(), setID()
Methods inherited from TApplicationComponent
getApplication(), getRequest(), getResponse(), getService(), getSession(), getUser(), publishAsset(), publishFilePath()
Methods inherited from TComponent
__call(), __destruct(), __get(), __isset(), __set(), __sleep(), __unset(), __wakeup(), addParsedObject(), asa(), attachBehavior(), attachBehaviors(), attachClassBehavior(), attachEventHandler(), canGetProperty(), canSetProperty(), clearBehaviors(), createdOnTemplate(), detachBehavior(), detachBehaviors(), detachClassBehavior(), detachEventHandler(), disableBehavior(), disableBehaviors(), enableBehavior(), enableBehaviors(), evaluateExpression(), evaluateStatements(), fxAttachClassBehavior(), fxDetachClassBehavior(), getAutoGlobalListen(), getBehaviorsEnabled(), getClassHierarchy(), getEventHandlers(), getListeningToGlobalEvents(), getSubProperty(), hasEvent(), hasEventHandler(), hasProperty(), isa(), listen(), raiseEvent(), setSubProperty(), unlisten()
Constants inherited from TComponent
GLOBAL_RAISE_EVENT_LISTENER
Properties summary
protected TRpcServer $rpcServer
#

instance

instance

Terms of Service | Contact Us
PRADO v3.2.4 API Manual API documentation generated by ApiGen 2.8.0
Copyright © 2006-2014 by the PRADO Group.
Powered by PRADO