Documentation

BaseCollection
in package
implements ArrayAccess, IteratorAggregate

A LessQL Collection

Table of Contents

Interfaces

ArrayAccess
IteratorAggregate

Constants

ITEMS_PER_PAGE  = 50

Properties

$className  : string
$items  : array<string|int, mixed>
$stmt  : Result|null

Methods

__construct()  : mixed
addCondition()  : static
adds condition to collection
addGroupBy()  : static
addHaving()  : static
addOrder()  : static
adds order to collection
addSelect()  : static
count()  : int
delete()  : static
fetchAllDbRows()  : mixed
fetchDbRow()  : mixed
getFirst()  : mixed
getItems()  : array<string|int, mixed>
gets collection items
getIterator()  : Traversable|ArrayIterator
getSelect()  : Result
get collection select object
getTableName()  : string
gets collection objects table name
limit()  : static
limit results
load()  : static
loads collection items
offsetExists()  : bool
offsetGet()  : mixed
offsetSet()  : void
offsetUnset()  : void
paginate()  : array<string|int, mixed>
return subset of found items (useful for paginate)
persist()  : static
persists collection items
remove()  : static
removes collection items
reset()  : static
resets collection
save()  : static
where()  : static
finds elements
getDb()  : Database
gets db service

Constants

Properties

$items

protected array<string|int, mixed> $items = []

collection loaded items

Methods

__construct()

public __construct(string $className) : mixed
Parameters
$className : string

addCondition()

adds condition to collection

public addCondition([array<string|int, mixed>|string|null $condition = [] ]) : static
Parameters
$condition : array<string|int, mixed>|string|null = []
Return values
static

addGroupBy()

public addGroupBy(string $groupBy) : static
Parameters
$groupBy : string
Return values
static

addHaving()

public addHaving(string $having) : static
Parameters
$having : string
Return values
static

addOrder()

adds order to collection

public addOrder([array<string|int, mixed>|string $order = [] ][, string $position = 'end' ]) : static
Parameters
$order : array<string|int, mixed>|string = []
$position : string = 'end'
Return values
static

addSelect()

public addSelect(string $select) : static
Parameters
$select : string
Return values
static

getItems()

gets collection items

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

getIterator()

public getIterator() : Traversable|ArrayIterator
Return values
Traversable|ArrayIterator

getSelect()

get collection select object

public getSelect() : Result
Return values
Result

getTableName()

gets collection objects table name

public getTableName() : string
Return values
string

limit()

limit results

public limit(int $page_size[, int $start = 0 ]) : static
Parameters
$page_size : int
$start : int = 0
Return values
static

load()

loads collection items

public load() : static
Return values
static

offsetExists()

public offsetExists(mixed $offset) : bool
Parameters
$offset : mixed
Return values
bool

offsetGet()

public offsetGet(mixed $offset) : mixed
Parameters
$offset : mixed

offsetSet()

public offsetSet(mixed $offset, mixed $value) : void
Parameters
$offset : mixed
$value : mixed

offsetUnset()

public offsetUnset(mixed $offset) : void
Parameters
$offset : mixed

paginate()

return subset of found items (useful for paginate)

public paginate(Request $request[, int $page_size = self::ITEMS_PER_PAGE ]) : array<string|int, mixed>
Parameters
$request : Request
$page_size : int = self::ITEMS_PER_PAGE
Tags
throws
DependencyException
throws
NotFoundException
Return values
array<string|int, mixed>

persist()

persists collection items

public persist() : static
Return values
static

remove()

removes collection items

public remove() : static
Return values
static

reset()

resets collection

public reset() : static
Return values
static

where()

finds elements

public where(array<string|int, mixed>|string $condition[, array<string|int, mixed> $order = [] ][, int $page_size = null ][, int $start = 0 ]) : static
Parameters
$condition : array<string|int, mixed>|string
$order : array<string|int, mixed> = []
$page_size : int = null
$start : int = 0
Tags
throws
DependencyException
throws
NotFoundException
Return values
static

getDb()

gets db service

protected getDb() : Database
Return values
Database

        
On this page

Search results