Class Api2Controller
2nd generation REST API for X2Engine.
Has the following conventions:
General:
- The bodies of all requests sent and all responses received to/from this controller shall be JSON-encoded, not URL-encoded as in traditional POST (i.e. as if to mimic form submission)
- HTTP Basic authentication in use. Note, this allows direct browser explorability via entering the username and API key when prompted.
- The status code is to be included in the "status" property of the response, if it is not in the "success" category.
- The "Content-Type" header in all responses shall be "application/json"
Model-Centric (Active Record) Actions:
- If the request is successful, the returned object should not be within an envelope.
- All URLs referring to operations on existing records shall end in ".json"
- In responses with errors, the "errors" property is to contain the validation errors as returned from CActiveRecord.getErrors()
- CComponent
- CBaseController
- CController
- Api2Controller
Author: Demitri Morgan <demitri@x2engine.com>
Located at x2engine/protected/controllers/Api2Controller.php
public
|
|
public
|
#
actionCount( string $_class, array $_findBy = null )
Retrieve the number of models of a specific class or matching query criteria |
public
|
|
public
|
|
public
|
|
public
|
#
actionHooks( integer $_id = null, string $_class = null )
Action for the creation of "hooks" (see |
public
|
#
actionModel( string $_class, integer $_id = null, array $_findBy = null )
Basic operations on an X2Engine model. |
public
|
|
public
|
#
actionRelationships( type $_class = null, type $_id = null, type $_relatedId = null )
Action for viewing or modifying relationships on a model. |
public
|
#
actionTags( string $_class = null, integer $_id = null, type $_tagName = null )
Query, add, or remove tags on a model. |
public
|
|
public
|
|
public
|
#
actionZapierFields( type $_class, mixed $_permissionLevel = 1 )
Returns a list of fields in the format required by Zapier's custom action fields feature. |
public
|
|
public
|
#
attributesOf( CActiveRecord $model )
Returns the viewable attributes of an active record model in an array. |
public
|
|
public
type
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
#
filterMethods( type $filterChain )
Halts execution if the method does not match the list of acceptable methods for the action. |
public
|
#
filterRbac( type $filterChain )
Performs RBAC permission checks before allowing access to something. |
public
array
|
|
public
array
|
#
findConditions( string $condition, mixed $validAttributes = array() )
Generates attributes from a query parameter |
public
|
#
getDataProvider( string $modelClass = null, CDbCriteria $extraCriteria = null, string $combineOp = 'AND' )
Creates a CActiveDataProvider object for search queries. |
public
|
|
public
array
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
#
kludgesForSearchingActions( type & $searchAttributes, CDbCriteria $criteria )
Work-arounds for querying records of the Actions class, which is special |
public
|
|
public static
type
|
|
public
|
|
public
|
|
public
|
|
public
type
|
#
setModelAttributes( type $fields = array() )
Sets the current acting model with data submitted to the server. |
public
|
__construct(),
accessRules(),
actions(),
afterRender(),
beforeAction(),
beforeRender(),
clearPageStates(),
createAbsoluteUrl(),
createAction(),
createActionFromMap(),
createUrl(),
filterAccessControl(),
filterAjaxOnly(),
filterPostOnly(),
forward(),
getAction(),
getActionParams(),
getCachingStack(),
getClips(),
getId(),
getLayoutFile(),
getModule(),
getPageState(),
getPageTitle(),
getRoute(),
getUniqueId(),
getViewFile(),
getViewPath(),
init(),
invalidActionParams(),
isCachingStackEmpty(),
loadPageStates(),
missingAction(),
processDynamicOutput(),
processOutput(),
recordCachingAction(),
redirect(),
refresh(),
render(),
renderClip(),
renderDynamic(),
renderDynamicInternal(),
renderPartial(),
renderText(),
replaceDynamicOutput(),
resolveViewFile(),
run(),
runAction(),
runActionWithFilters(),
savePageStates(),
setAction(),
setPageState(),
setPageTitle()
|
beginCache(),
beginClip(),
beginContent(),
beginWidget(),
createWidget(),
endCache(),
endClip(),
endContent(),
endWidget(),
renderFile(),
renderInternal(),
widget()
|
__call(),
__get(),
__isset(),
__set(),
__unset(),
asa(),
attachBehavior(),
attachBehaviors(),
attachEventHandler(),
canGetProperty(),
canSetProperty(),
detachBehavior(),
detachBehaviors(),
detachEventHandler(),
disableBehavior(),
disableBehaviors(),
enableBehavior(),
enableBehaviors(),
evaluateExpression(),
getEventHandlers(),
hasEvent(),
hasEventHandler(),
hasProperty(),
raiseEvent()
|
boolean |
ENABLED
|
true |
|
integer |
MAX_PAGE_SIZE
|
1000 |
|
string |
FIND_DELIM
|
';' |
|
string |
FIND_EQUAL
|
'=' |
STATE_INPUT_NAME
|
$defaultAction,
$layout
|
public
CActiveDataProvider
|
$dataProvider |
#
A data provider for performing searches via API using special underscore-prefixed query parameters: _page, _limit and _order. |
public
boolean
|
$enabled |
#
Returns true or false based on whether API access is enabled. |
public
array
|
$jpost |
#
(read-only) JSON data posted to the server. This should be used instead of the superglobal $_POST because PHP does not natively support parsing the request body into $_POST unless it's URL-form -encoded data. |
public
integer
|
$maxPageSize |
#
Maximum page size. |
public
|
$model |
#
Active record instance, when/where applicable |
public
array
|
$reservedParams |
#
Underscore-prefixed parameters used by the API |
public
string
|
$responseBody |
#
(write-only) The body of the response to be sent |
public
Api2Settings
|
$settings |
#
(Platinum Edition only) Advanced API settings |
public
|
$staticModel |
#
Static model instance, when/where applicable |
$action,
$actionParams,
$cachingStack,
$clips,
$id,
$module,
$pageTitle,
$route,
$uniqueId,
$viewPath
|