Ajax
in package
Ajax operation base class
Table of Contents
- $context : Context
- $controller : Ajax
- __construct() : mixed
- Constructor
- handle() : void
- Handle AJAX operations
- requires() : array<, mixed>
- Return permission requirements
- checkAccess() : void
- Check access to a bean
- fieldExists() : bool
- Check that a bean has a field. Do not allow id field to be manipulated.
- restCheck() : array<, mixed>
- Check URL string for n parameter values and pull them out
- checkPerms() : void
- Check that user has the permissions that are specified in an array
Properties
$context
protected
Context
$context
$controller
protected
Ajax
$controller
Methods
__construct()
Constructor
public
__construct(Context $context, Ajax $controller) : mixed
Parameters
Return values
mixed —handle()
Handle AJAX operations
public
abstract handle() : void
Return values
void —requires()
Return permission requirements
public
requires() : array<, mixed>
Return values
array<, mixed> —checkAccess()
Check access to a bean
protected
final checkAccess(OODBBean|null $user, array<, mixed> $permissions, string $bean[, string $field = '' ][, bool $idOK = FALSE ]) : void
Parameters
- $user : OODBBean|null
- $permissions : array<, mixed>
- $bean : string
- $field : string = ''
- $idOK : bool = FALSE
Tags
Return values
void —fieldExists()
Check that a bean has a field. Do not allow id field to be manipulated.
protected
final fieldExists(string $type, string $field[, bool $idok = FALSE ]) : bool
Parameters
- $type : string
-
The type of bean
- $field : string
-
The field name
- $idok : bool = FALSE
-
Allow the id field
Tags
Return values
bool —restCheck()
Check URL string for n parameter values and pull them out
protected
restCheck(int $count) : array<, mixed>
The value in $rest[0] is assumed to be an opcode so we always start at $rest[1]
Parameters
- $count : int
-
The number to check for
Tags
Return values
array<, mixed> —The parameter values in an array indexed from 0 with last parameter, anything left in an array
checkPerms()
Check that user has the permissions that are specified in an array
private
checkPerms(OODBBean|null $user, array<, mixed> $pairs) : void
Parameters
- $user : OODBBean|null
-
The current user or NULL
- $pairs : array<, mixed>
-
The permission array