Property | Type | Description | |
---|---|---|---|
$deSerializer | RESTfulAPI_DeSerializer | Current deSerializer instance | |
$requestedData | array | Stores the currently requested data |
Method | Description | |
---|---|---|
createModel ( string $model, SS_HTTPRequest $request ) : DataObject | Create object of class $model | |
deleteModel ( string $model, integer $id, SS_HTTPRequest $request ) : null | array | Delete object of Class $model and ID $id | |
findModel ( string $model, boolean | integr $id = false, array $queryParams, SS_HTTPRequest $request ) : DataObject | DataList | Finds 1 or more objects of class $model | |
getdeSerializer ( ) : RESTfulAPI_DeSerializer | Return current RESTfulAPI DeSerializer instance | |
handleQuery ( SS_HTTPRequest $request ) : DataObjec | DataList | All requests pass through here and are redirected depending on HTTP verb and params | |
parseQueryParameters ( array $params ) : array | Parse the query parameters to appropriate Column, Value, Search Filter Modifiers array( array( 'Column' => ColumnName, 'Value' => ColumnValue, 'Modifier' => ModifierType ) ) | |
updateModel ( String | DataObject $model, integer $id, $request ) : DataObject | Update databse record or $model |
public createModel ( string $model, SS_HTTPRequest $request ) : DataObject | ||
$model | string | |
$request | SS_HTTPRequest | |
return | DataObject |
public findModel ( string $model, boolean | integr $id = false, array $queryParams, SS_HTTPRequest $request ) : DataObject | DataList | ||
$model | string | Model(s) class to find |
$id | boolean | integr | The ID of the model to find or false |
$queryParams | array | Query parameters and modifiers |
$request | SS_HTTPRequest | The original HTTP request |
return | DataObject | DataList | Result of the search (note: DataList can be empty) |
public getdeSerializer ( ) : RESTfulAPI_DeSerializer | ||
return | RESTfulAPI_DeSerializer | DeSerializer instance |
public handleQuery ( SS_HTTPRequest $request ) : DataObjec | DataList | ||
$request | SS_HTTPRequest | HTTP request |
return | DataObjec | DataList | DataObject/DataList result or stdClass on error |
public parseQueryParameters ( array $params ) : array | ||
$params | array | raw GET vars array |
return | array | formatted query parameters |
public updateModel ( String | DataObject $model, integer $id, $request ) : DataObject | ||
$model | String | DataObject | the model or class to update |
$id | integer | The ID of the model to update |
return | DataObject | The updated model |
public RESTfulAPI_DeSerializer $deSerializer | ||
return | RESTfulAPI_DeSerializer |
public array $requestedData | ||
return | array |