PHP 클래스 Prado\Web\Services\TRpcApiProvider

TRpcApiProvider is an abstract class the can be subclasses in order to implement an api for a {@link TRpcService}. A subclass of TRpcApiProvider must implement the {@link 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 {@link TRpcService}'s documentation.
부터: 3.2
저자: Robin J. Rogge ([email protected])
상속: extends Prado\TModule
파일 보기 프로젝트 열기: pradosoft/prado

보호된 프로퍼티들

프로퍼티 타입 설명
$rpcServer instance

공개 메소드들

메소드 설명
__construct ( TRpcServer $rpcServer ) Constructor: informs the rpc server of the registered methods
getRpcServer ( ) : rpc
processRequest ( ) : processed Processes the request using the server
registerMethods ( ) Must return an array of the available methods

메소드 상세

__construct() 공개 메소드

Constructor: informs the rpc server of the registered methods
public __construct ( TRpcServer $rpcServer )
$rpcServer TRpcServer

getRpcServer() 공개 메소드

public getRpcServer ( ) : rpc
리턴 rpc server instance

processRequest() 공개 메소드

Processes the request using the server
public processRequest ( ) : processed
리턴 processed request

registerMethods() 추상적인 공개 메소드

Must return an array of the available methods
abstract public registerMethods ( )

프로퍼티 상세

$rpcServer 보호되어 있는 프로퍼티

instance
protected $rpcServer