AbstractAction
abstract class AbstractAction implements ArrayAccess
Base class for all api actions.
Properties
protected int | $version | Api version number; cannot be changed. | |
protected array | $chain | Additional api requests - will be called once per result. | |
protected bool | $checkPermissions | Whether to enforce acl permissions based on the current user. | |
protected string | $_entityName | ||
protected string | $_actionName |
Methods
Action constructor.
Strictly enforce api parameters
No description
Magic function to provide addFoo, getFoo and setFoo for params.
Serialize this object's params into an array
Get documentation for one or all params
No description
No description
No description
No description
No description
No description
No description
No description
Is this api call permitted?
No description
Returns schema fields for this entity & action.
No description
Validates required fields for actions which create a new object.
This function is used internally for evaluating field annotations.
No description
No description
Details
at line 133
__construct(string $entityName, string $actionName)
Action constructor.
at line 149
__set($name, $value)
Strictly enforce api parameters
at line 158
$this
setVersion(int $val)
at line 174
$this
addChain(string $name, AbstractAction $apiRequest, string|int $index = NULL)
at line 187
AbstractAction|mixed
__call($name, $arguments)
Magic function to provide addFoo, getFoo and setFoo for params.
at line 231
Result
execute()
Invoke api call.
At this point all the params have been sent in and we initiate the api call & return the result. This is basically the outer wrapper for api v4.
at line 241
abstract
_run(Result $result)
at line 247
array
getParams()
Serialize this object's params into an array
at line 265
array
getParamInfo(string $param = NULL)
Get documentation for one or all params
at line 282
string
getEntityName()
at line 290
string
getActionName()
at line 298
bool
paramExists(string $param)
at line 305
protected array
getParamDefaults()
at line 312
offsetExists($offset)
at line 319
offsetGet($offset)
at line 344
offsetSet($offset, $value)
at line 359
offsetUnset($offset)
at line 373
bool
isAuthorized()
Is this api call permitted?
This function is called if checkPermissions is set to true.
at line 381
array
getPermissions()
at line 410
array
entityFields()
Returns schema fields for this entity & action.
Here we bypass the api wrapper and execute the getFields action directly. This is because we DON'T want the wrapper to check permissions as this is an internal op, but we DO want permissions to be checked inside the getFields request so e.g. the api_key field can be conditionally included.
at line 429
ReflectionClass
reflect()
at line 443
protected array
checkRequiredFields($values)
Validates required fields for actions which create a new object.
at line 473
protected bool
evaluateCondition(string $expr, array $vars)
This function is used internally for evaluating field annotations.
It should never be passed raw user input.