\Localgod\TickResult

Result

The result class helps you query your model and manage result sets

Summary

Methods
Properties
Constants
__construct()
count()
isEmpty()
where()
whereEquals()
whereBetween()
whereAnyMatches()
orderBy()
limit()
offset()
rewind()
current()
key()
next()
valid()
No public properties found
DEFAULT_LIMIT
No protected methods found
No protected properties found
N/A
getResult()
getModel()
$position
$conditions
$limit
$offset
$result
$model
$order
$direction
N/A

Constants

DEFAULT_LIMIT

DEFAULT_LIMIT

The default max result we get as a safety precaution

Properties

$position

$position : integer

Position in result set

Type

integer

$conditions

$conditions : array

Condintions

Type

array

$limit

$limit : integer

Limit value

Type

integer

$offset

$offset : integer

Offset value

Type

integer

$result

$result : array

List of object

Type

array

$model

$model : Object

Instance of the model we query

Type

Object

$order

$order : array

Order of result

Type

array

$direction

$direction : boolean

Direction of result

Type

boolean

Methods

__construct()

__construct(Object  $model) 

Construct a new result

Parameters

Object $model

Model to get results from

count()

count() : integer

Count elements in result

Returns

integer

isEmpty()

isEmpty() : boolean

Are there elements in result?

Returns

boolean

where()

where(string  $property, string  $condition, mixed  $value) : \Localgod\Tick\Result

Create criteria

Parameters

string $property

Property

string $condition

Condition

mixed $value

Value

Returns

\Localgod\Tick\Result

whereEquals()

whereEquals(string  $property, mixed  $value) : \Localgod\Tick\Result

Create equals criteria

Parameters

string $property

Property

mixed $value

Value

Returns

\Localgod\Tick\Result

whereBetween()

whereBetween(string  $property, mixed  $valueOne, mixed  $valueTwo) : \Localgod\Tick\Result

Create between criteria

Parameters

string $property

Property

mixed $valueOne

Value one

mixed $valueTwo

Value two

Returns

\Localgod\Tick\Result

whereAnyMatches()

whereAnyMatches(string  $string) : \Localgod\Tick\Result

Create a loose string match criteria on all fields.

Parameters

string $string

String

Returns

\Localgod\Tick\Result

orderBy()

orderBy(array|string  $properties, boolean  $direction = true) : \Localgod\Tick\Result

Set an order clause for det result

Parameters

array|string $properties

Properties to order by

boolean $direction

Direction of the order (true = ascending, false descending)

Returns

\Localgod\Tick\Result

limit()

limit(integer  $limit) : \Localgod\Tick\Result

Limit the result set

Parameters

integer $limit

Limit

Returns

\Localgod\Tick\Result

offset()

offset(integer  $offset) : \Localgod\Tick\Result

Offset the result set

Parameters

integer $offset

Offset

Returns

\Localgod\Tick\Result

rewind()

rewind() : void

Rewind the interator

current()

current() : void

Get the current

key()

key() : integer

Get the current key

Returns

integer

next()

next() : void

Set the key to the next element in the result

valid()

valid() : boolean

Check if the position in the result set is valid

Returns

boolean

getResult()

getResult() : array

Get result

Returns

array

getModel()

getModel(integer  $position) : Object

Get model

Parameters

integer $position

Position in result

Returns

Object