Properties

$status

$status : 

Type

$message

$message : 

Type

$data

$data : 

Type

$errors

$errors : 

Type

$seconddata

$seconddata : 

Type

$sortby

$sortby : 

Type

Methods

__construct()

__construct(boolean  $status = false, string  $message = "", array  $values = array(), array  $secvalues = array()) 

construct a new instance of the result object

Parameters

boolean $status

The boolean state of the initialised status

string $message

The first message

array $values

The initial result data set

array $secvalues

The initial secondary result data set

SetErrorMessage()

SetErrorMessage(string  $msg, array  $var = null) 

Set error message

Convenience function to set message and status at once Set the message and the status to false

Parameters

string $msg

The new message

array $var

An associative array with variable parameters to parse into the translation

ClearMessage()

ClearMessage() 

Clear messages

setMessage()

setMessage(string  $msg, array  $var = null) 

add or override the current message

Parameters

string $msg

The new message

array $var

An associative array with variable parameters to parse into the translation

AddEntry()

AddEntry(mixed  $entry, integer  $max) 

Append entry

This method adds the given entry to the result data It converts the data storage to an array on demand

Parameters

mixed $entry

A new entry to the result set

integer $max

The maximum count of elements

AddEntryAssoc()

AddEntryAssoc(string  $key, mixed  $value) 

Add associative entry

This method adds a new entry to the result data object It converts the data storage to an array on demand

Parameters

string $key

The assoc key

mixed $value

A new entry to the result set

setError()

setError(string|array  $key, string  $val = '', array  $var = null) 

Set new error Can set an array of errors or a assoc error entry

Parameters

string|array $key

The key of the message

string $val

The Value of the message

array $var

An associative array with variable parameters to parse into the translation

GetErrorsCount()

GetErrorsCount() : integer

state count errors get the numeric count of registered errors

Returns

integer —

The count of local errors

hasErrors()

hasErrors() : boolean

Check if this status has errors Returns true if this result object has errors in the buffer.

Returns

boolean —

Result if this object has errors

Count()

Count() : boolean|integer

The amount of values Count the length of the result data set

Returns

boolean|integer

setValues()

setValues(mixed  $data, boolean  $append = false) 

Set the current data

Parameters

mixed $data

The new data for the values

boolean $append

SetValidValues()

SetValidValues(  $data) 

Override the current data and set status true

Parameters

$data

(var) The new data for the values

SetResponses()

SetResponses(\FAA\Obj\Result  $result, boolean  $full = false) 

Merge error result Merge with other error result object

Parameters

\FAA\Obj\Result $result

The other result

boolean $full

Also merge data on demand

SetSecondaryValues()

SetSecondaryValues(mixed  $data, mixed  $value = null) 

add or override the current data

Parameters

mixed $data

The new data set or a key name

mixed $value

The new value when data was a string key

SetSecondaryValue()

SetSecondaryValue(  $key,   $data) 

Parameters

$key
$data

getValue()

getValue(string  $key) : mixed

Get the data by key

Get a node of the plain buffered values. Supports array and object values

Parameters

string $key

A certain value part to return

Returns

mixed —

The property or value when inside the stoarage, otherwise null

getValues()

getValues(string  $sort_by = null) : mixed

Get the data sorted by Get the plain buffered value

Parameters

string $sort_by

Set to certain existing key to enable sorted response or false

Returns

mixed —

The property or value when inside the storage, otherwise null

_sort()

_sort(  $a,   $b) 

Parameters

$a
$b

GetAssoc()

GetAssoc(integer  $format = FAA_RESULT_TYPE_PLAIN, string  $l = '', boolean  $empty_null = false) : array

get the data get all the data as assoc array

Parameters

integer $format

The result format type

string $l

The result language

boolean $empty_null

When true, empty values will be skipped

Returns

array —

The associative representation of this object

getSecondaryValues()

getSecondaryValues() 

get the data get the whole secondary data set

setStatus()

setStatus(  $status) 

add or override the current status

Parameters

$status

(boolean) The new status

getStatus()

getStatus() 

get the current status getter for the local status

getErrors()

getErrors(integer  $format = FAA_RESULT_TYPE_PLAIN, string  $l = '') : array|string

get the error messages Translate errors or get plain data.

Parameters

integer $format

The result format type

string $l

The result language

Returns

array|string —

Either the plain set of errors or a translated message

getMessage()

getMessage(integer  $format = FAA_RESULT_TYPE_PLAIN, string  $l = '') : array|string

get the messages Translate errors or get plain data.

Parameters

integer $format

The result format type

string $l

The result language

Returns

array|string —

Either the plain set of errors or a translated message

map()

map(array  $assoc, string  $l = '') : string

map and translate data create a readable result string from a given set of result templates

Parameters

array $assoc

A combined text with arguments to map

string $l

The target translation language code or false in plain mode

Returns

string —

The mapped translated template with parsed args