\Gishiki\Database\RuntimeSelectionCriteria

This class is used to represent a selection criteria for database rows.

Summary

Methods
Properties
Constants
select()
andWhere()
orWhere()
No public properties found
AND_HISTORIC_MARKER
where()
$historic
$criteria
N/A
export()
No private properties found
N/A

Constants

AND_HISTORIC_MARKER

AND_HISTORIC_MARKER

Properties

$historic

$historic : array

Type

array — keeps track of the order clauses were inserted

$criteria

$criteria : array

Type

array — both 'or' and 'and' are two arrays of sub-arrays

Methods

select()

select(array  $selection = array()) 

Parameters

array $selection

andWhere()

andWhere(string  $field, integer  $relation, mixed  $data) : \Gishiki\Database\Runtime\SelectionCriteria

Create a sub-clause and append it to the where clause using an and as conjunction.

Parameters

string $field

the name of the field/column to be related with the data

integer $relation

the Relation between the field and the data

mixed $data

the data to be related with the field

Throws

\InvalidArgumentException

one parameter has a wrong type

Returns

\Gishiki\Database\Runtime\SelectionCriteria

the updated selection criteria

orWhere()

orWhere(string  $field, integer  $relation, mixed  $data) : \Gishiki\Database\Runtime\SelectionCriteria

Create a sub-clause and append it to the where clause using an or as conjunction.

Parameters

string $field

the name of the field/column to be related with the data

integer $relation

the Relation between the field and the data

mixed $data

the data to be related with the field

Throws

\InvalidArgumentException

one parameter has a wrong type

Returns

\Gishiki\Database\Runtime\SelectionCriteria

the updated selection criteria

where()

where(string  $clause, string  $field, integer  $relation, mixed  $data) : \Gishiki\Database\Runtime\SelectionCriteria

Create a sub-clause and append it to the where clause using an and as conjunction.

Parameters

string $clause

can either be 'and' or 'or'

string $field

the name of the field/column to be related with the data

integer $relation

the Relation between the field and the data

mixed $data

the data to be related with the field

Throws

\InvalidArgumentException

one parameter has a wrong type

Returns

\Gishiki\Database\Runtime\SelectionCriteria

the updated selection criteria

export()

export()