PHP Class OEModule\PASAPI\controllers\V1Controller

Inheritance: extends CController
Show file Open project: openeyes/openeyes

Public Properties

Property Type Description
$PARTIAL_RECORD_HEADER
$UPDATE_ONLY_HEADER

Protected Properties

Property Type Description
$output_format output format defaults to xml
$resources
$supported_formats
$version

Public Methods

Method Description
actionDelete ( $resource_type, $id )
actionUpdate ( $resource_type, $id )
beforeAction ( CAction $action ) : boolean
createAction ( string $actionID ) : CAction | CInlineAction This overrides the default behaviour for supported resources by pushing the resource into the GET parameter and updating the actionID.
expectedParametersForAction ( $action ) Simple wrapper to encapsulate the arguments required for any of the API actions.
getPartialRecord ( ) : boolean Whether the request is a partial record which only sets the fields that are provided on the given record.
getResourceModel ( $resource_type )
getUpdateOnly ( ) : boolean Whether the request is an "updateOnly" request.
invalidActionParams ( CAction $action )

Protected Methods

Method Description
getContentType ( ) : string
sendErrorResponse ( $status, $messages = [] )
sendResponse ( $status = 200, $body = '' )
sendSuccessResponse ( $status, $response )

Method Details

actionDelete() public method

public actionDelete ( $resource_type, $id )

actionUpdate() public method

public actionUpdate ( $resource_type, $id )
$resource_type
$id

beforeAction() public method

public beforeAction ( CAction $action ) : boolean
$action CAction
return boolean

createAction() public method

This is necessary because there's no way of pushing the appropriate pattern to the top of the URLManager config, so this captures calls where the id doesn't contain non-numerics.
public createAction ( string $actionID ) : CAction | CInlineAction
$actionID string
return CAction | CInlineAction

expectedParametersForAction() public method

Simple wrapper to encapsulate the arguments required for any of the API actions.
public expectedParametersForAction ( $action )

getContentType() protected method

protected getContentType ( ) : string
return string

getPartialRecord() public method

Whether the request is a partial record which only sets the fields that are provided on the given record.
public getPartialRecord ( ) : boolean
return boolean

getResourceModel() public method

public getResourceModel ( $resource_type )

getUpdateOnly() public method

Whether the request is an "updateOnly" request.
public getUpdateOnly ( ) : boolean
return boolean

invalidActionParams() public method

public invalidActionParams ( CAction $action )
$action CAction

sendErrorResponse() protected method

protected sendErrorResponse ( $status, $messages = [] )

sendResponse() protected method

protected sendResponse ( $status = 200, $body = '' )

sendSuccessResponse() protected method

protected sendSuccessResponse ( $status, $response )

Property Details

$PARTIAL_RECORD_HEADER public static property

public static $PARTIAL_RECORD_HEADER

$UPDATE_ONLY_HEADER public static property

public static $UPDATE_ONLY_HEADER

$output_format protected property

output format defaults to xml
protected $output_format

$resources protected static property

protected static $resources

$supported_formats protected static property

protected static $supported_formats

$version protected static property

protected static $version