Documentation

AccessBase extends Base
in package

A class that provides helpers for accessing form data

Table of Contents

$super  : array<string|int, mixed>
$which  : int
__construct()  : mixed
Constructor
exists()  : bool
Is the key in the array?
fetch()  : mixed
Look in the array for a key and return its trimmed value or a default value
fetchAll()  : ArrayIterator
Return an ArrayIterator over all the values in the form
fetchArray()  : ArrayIterator
Look in the array for a key that is an array and return an ArrayIterator over it
fetchRaw()  : array<string|int, mixed>
Return the array of values
mustExist()  : bool
Is the key in the array?
mustFetch()  : mixed
Look in the array for a key and return its trimmed value
mustFetchArray()  : ArrayIterator
Look in the array for a key that is an array and return an ArrayIterator over it
mustFetchBean()  : OODBBean
Look in the array for a key that is an id for a bean
getSuper()  : array<string|int, mixed>
Return the relevant Superglobal

Properties

$super

protected array<string|int, mixed> $super

$which

protected int $which

Methods

__construct()

Constructor

public __construct(int|null $which) : mixed
Parameters
$which : int|null

The appropriate INPUT_ filter or NULL (which will be for PUT/PATCH...)

Return values
mixed

exists()

Is the key in the array?

public exists(mixed $name) : bool
Parameters
$name : mixed

The keys

Tags
TODO

Fix the need for two calls. They are there because getval does an array check which is not relevant for an existence check. We need a three valued boolean :-)

Return values
bool

fetch()

Look in the array for a key and return its trimmed value or a default value

public fetch(string|array<string|int, mixed> $name[, mixed $default = '' ][, int|null $filter = NULL ][, mixed $options = [] ][, bool $isArray = FALSE ]) : mixed

N.B. This function assumes the value is a string and will fail if used on array values

Parameters
$name : string|array<string|int, mixed>

The key or if it is an array then the key and the fields that are needed XXX['xyz'][0]

$default : mixed = ''

Returned if the key does not exist

$filter : int|null = NULL

Filter to apply

$options : mixed = []

Filter options

$isArray : bool = FALSE

If TRUE then expect an array rather than a simple value

Return values
mixed

fetchAll()

Return an ArrayIterator over all the values in the form

public fetchAll() : ArrayIterator
Return values
ArrayIterator

fetchArray()

Look in the array for a key that is an array and return an ArrayIterator over it

public fetchArray(mixed $name[, array<string|int, mixed> $default = [] ]) : ArrayIterator
Parameters
$name : mixed

The key

$default : array<string|int, mixed> = []
Return values
ArrayIterator

fetchRaw()

Return the array of values

public fetchRaw() : array<string|int, mixed>
Return values
array<string|int, mixed>

mustExist()

Is the key in the array?

public mustExist(mixed $name) : bool
Parameters
$name : mixed

The keys

Tags
TODO

Fix the need for two calls. They are there because getval does an array check which is not relevant for an existence check. We need a three valued boolean :-)

throws
BadValue
Return values
bool

mustFetch()

Look in the array for a key and return its trimmed value

public mustFetch(string|array<string|int, mixed> $name[, int|null $filter = NULL ][, array<string|int, mixed>|int $options = [] ][, bool $isArray = FALSE ]) : mixed

N.B. This function assumes the value is a string and will fail if used on array values

Parameters
$name : string|array<string|int, mixed>

The key or if it is an array then the key and the fields that are needed $_GET['xyz'][0]

$filter : int|null = NULL

Filter to apply

$options : array<string|int, mixed>|int = []

Filter options

$isArray : bool = FALSE

Expect an array ratherthan a simple value

Return values
mixed

mustFetchArray()

Look in the array for a key that is an array and return an ArrayIterator over it

public mustFetchArray(mixed $name) : ArrayIterator
Parameters
$name : mixed

The key or if it is an array then the key and the fields that are needed XXX['xyz'][0]

Tags
throws
BadValue
Return values
ArrayIterator

mustFetchBean()

Look in the array for a key that is an id for a bean

public mustFetchBean(mixed $name, string $bean[, bool $forupdate = FALSE ]) : OODBBean

N.B. This function assumes the value is a string and will fail if used on array values

Parameters
$name : mixed

The key or if it is an array then the key and the fields that are needed XXX['xyz'][0]

$bean : string

The bean type

$forupdate : bool = FALSE

If TRUE then load for update

Return values
OODBBean

getSuper()

Return the relevant Superglobal

protected getSuper([int $which = NULL ]) : array<string|int, mixed>

@TODO Change this to use match() when PHP 8 is released

Parameters
$which : int = NULL

@return array

Return values
array<string|int, mixed>

Search results