BaseCollection
extends ContainerAwareObject
in package
implements
ArrayAccess, IteratorAggregate
A LessQL Collection
Table of Contents
Interfaces
- ArrayAccess
- IteratorAggregate
Constants
- ITEMS_PER_PAGE = 50
Properties
- $translators : array<string|int, mixed>
- $className : string
- $container : ContainerInterface
- $items : array<string|int, mixed>
- $stmt : Result|null
Methods
- __call() : mixed
- {@inheritdoc}
- __construct() : mixed
- constructor
- addCondition() : static
- adds condition to collection
- addGroupBy() : static
- addHaving() : static
- addOrder() : static
- adds order to collection
- addSelect() : static
- containerCall() : mixed
- call method through container
- containerMake() : mixed
- create object through container
- count() : int
- delete() : static
- fetchAllDbRows() : mixed
- fetchDbRow() : mixed
- getApp() : App
- gets app object
- getAppRouteInfo() : RouteInfo|null
- gets route info
- getAppWebsite() : Website|null
- gets current website
- getAssets() : Manager
- gets assets manager
- getCache() : Manager
- get cache manager
- getContainer() : ContainerInterface
- gets container object
- getCrudRouter() : Crud
- gets crud service
- getDb() : Database
- gets db object
- getDebugbar() : StandardDebugBar
- gets debugbar object
- getEnv() : mixed
- gets env variable
- getEventManager() : SharedEventEmitter
- gets events manager service
- getFirst() : mixed
- getGoogleAuthenticator() : PHPGangsta_GoogleAuthenticator
- gets google authenticator service
- getGuzzle() : Client
- gets guzzle service
- getHtmlRenderer() : HtmlPartsRenderer
- gets html renderer service
- getIcons() : Icons
- gets icons service
- getImagine() : Imagine
- gets imagine service
- getItems() : array<string|int, mixed>
- gets collection items
- getIterator() : Traversable|ArrayIterator
- getLog() : Logger
- gets log object
- getMailer() : Mailer
- gets mailer service
- getPdo() : PDO
- gets PDO object
- getRedis() : Manager
- gets redis service
- getRequest() : Request
- gets current request object
- getRouters() : array<string|int, mixed>
- gets routers
- getSchema() : Schema
- gets schema object
- getSearch() : Manager
- gets search service
- getSelect() : Result
- get collection select object
- getSesMailer() : SesClient
- gets SES mailer service
- getSiteData() : SiteData
- gets site data service
- getSmtpMailer() : Swift_Mailer
- gets SMTP mailer service
- getTableName() : string
- gets collection objects table name
- getTemplates() : Engine
- gets plates engine object
- getTranslator() : Translator
- gets translator
- getUtils() : Globals
- gets global utils service
- getWebhooksRouter() : Webhooks
- gets webhooks service
- getWebRouter() : Web
- gets routing service
- getZip() : Zip
- gets zip service
- 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
- requestUrl() : string|bool
- executes an http request
- reset() : static
- resets collection
- save() : static
- where() : static
- finds elements
- getService() : mixed
- gets registered service
Constants
ITEMS_PER_PAGE
public
mixed
ITEMS_PER_PAGE
= 50
Properties
$translators
public
static array<string|int, mixed>
$translators
= []
translators
$className
protected
string
$className
$container
protected
ContainerInterface
$container
$items
protected
array<string|int, mixed>
$items
= []
collection loaded items
$stmt
protected
Result|null
$stmt
= null
collection statement
Methods
__call()
{@inheritdoc}
public
__call(string $name, mixed $arguments) : mixed
Parameters
- $name : string
- $arguments : mixed
Tags
__construct()
constructor
public
__construct(ContainerInterface $container, string $className) : mixed
Parameters
- $container : ContainerInterface
- $className : string
addCondition()
adds condition to collection
public
addCondition([array<string|int, mixed> $condition = [] ]) : static
Parameters
- $condition : array<string|int, mixed> = []
Return values
staticaddGroupBy()
public
addGroupBy(mixed $groupBy) : static
Parameters
- $groupBy : mixed
Return values
staticaddHaving()
public
addHaving(mixed $having) : static
Parameters
- $having : mixed
Return values
staticaddOrder()
adds order to collection
public
addOrder([array<string|int, mixed>|string $order = [] ][, mixed $position = 'end' ]) : static
Parameters
- $order : array<string|int, mixed>|string = []
- $position : mixed = 'end'
Return values
staticaddSelect()
public
addSelect(mixed $select) : static
Parameters
- $select : mixed
Return values
staticcontainerCall()
call method through container
public
containerCall(callable $callable[, array<string|int, mixed> $arguments = [] ]) : mixed
Parameters
- $callable : callable
- $arguments : array<string|int, mixed> = []
containerMake()
create object through container
public
containerMake(string $className[, array<string|int, mixed> $arguments = [] ]) : mixed
Parameters
- $className : string
- $arguments : array<string|int, mixed> = []
count()
public
count() : int
Return values
intdelete()
public
delete() : static
Return values
staticfetchAllDbRows()
public
fetchAllDbRows() : mixed
fetchDbRow()
public
fetchDbRow() : mixed
getApp()
gets app object
public
getApp() : App
Tags
Return values
AppgetAppRouteInfo()
gets route info
public
getAppRouteInfo() : RouteInfo|null
Return values
RouteInfo|nullgetAppWebsite()
gets current website
public
getAppWebsite() : Website|null
Return values
Website|nullgetAssets()
gets assets manager
public
getAssets() : Manager
Tags
Return values
ManagergetCache()
get cache manager
public
getCache() : Manager
Tags
Return values
ManagergetContainer()
gets container object
public
getContainer() : ContainerInterface
Return values
ContainerInterfacegetCrudRouter()
gets crud service
public
getCrudRouter() : Crud
Tags
Return values
CrudgetDb()
gets db object
public
getDb() : Database
Tags
Return values
DatabasegetDebugbar()
gets debugbar object
public
getDebugbar() : StandardDebugBar
Tags
Return values
StandardDebugBargetEnv()
gets env variable
public
getEnv(string $variable[, mixed $default = null ]) : mixed
Parameters
- $variable : string
- $default : mixed = null
Tags
getEventManager()
gets events manager service
public
getEventManager() : SharedEventEmitter
Tags
Return values
SharedEventEmittergetFirst()
public
getFirst() : mixed
getGoogleAuthenticator()
gets google authenticator service
public
getGoogleAuthenticator() : PHPGangsta_GoogleAuthenticator
Tags
Return values
PHPGangsta_GoogleAuthenticatorgetGuzzle()
gets guzzle service
public
getGuzzle() : Client
Tags
Return values
ClientgetHtmlRenderer()
gets html renderer service
public
getHtmlRenderer() : HtmlPartsRenderer
Tags
Return values
HtmlPartsRenderergetIcons()
gets icons service
public
getIcons() : Icons
Tags
Return values
IconsgetImagine()
gets imagine service
public
getImagine() : Imagine
Tags
Return values
ImaginegetItems()
gets collection items
public
getItems() : array<string|int, mixed>
Return values
array<string|int, mixed>getIterator()
public
getIterator() : Traversable|ArrayIterator
Return values
Traversable|ArrayIteratorgetLog()
gets log object
public
getLog() : Logger
Tags
Return values
LoggergetMailer()
gets mailer service
public
getMailer() : Mailer
Tags
Return values
MailergetPdo()
gets PDO object
public
getPdo() : PDO
Tags
Return values
PDOgetRedis()
gets redis service
public
getRedis() : Manager
Tags
Return values
ManagergetRequest()
gets current request object
public
getRequest() : Request
Tags
Return values
RequestgetRouters()
gets routers
public
getRouters() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed>getSchema()
gets schema object
public
getSchema() : Schema
Tags
Return values
SchemagetSearch()
gets search service
public
getSearch() : Manager
Tags
Return values
ManagergetSelect()
get collection select object
public
getSelect() : Result
Return values
ResultgetSesMailer()
gets SES mailer service
public
getSesMailer() : SesClient
Tags
Return values
SesClientgetSiteData()
gets site data service
public
getSiteData() : SiteData
Tags
Return values
SiteDatagetSmtpMailer()
gets SMTP mailer service
public
getSmtpMailer() : Swift_Mailer
Tags
Return values
Swift_MailergetTableName()
gets collection objects table name
public
getTableName() : string
Return values
stringgetTemplates()
gets plates engine object
public
getTemplates() : Engine
Tags
Return values
EnginegetTranslator()
gets translator
public
getTranslator([string|null $locale_code = null ]) : Translator
Parameters
- $locale_code : string|null = null
Tags
Return values
TranslatorgetUtils()
gets global utils service
public
getUtils() : Globals
Tags
Return values
GlobalsgetWebhooksRouter()
gets webhooks service
public
getWebhooksRouter() : Webhooks
Tags
Return values
WebhooksgetWebRouter()
gets routing service
public
getWebRouter() : Web
Tags
Return values
WebgetZip()
gets zip service
public
getZip() : Zip
Tags
Return values
Ziplimit()
limit results
public
limit(int $page_size[, int $start = 0 ]) : static
Parameters
- $page_size : int
- $start : int = 0
Return values
staticload()
loads collection items
public
load() : static
Return values
staticoffsetExists()
public
offsetExists(mixed $offset) : bool
Parameters
- $offset : mixed
Return values
booloffsetGet()
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
Return values
array<string|int, mixed>persist()
persists collection items
public
persist() : static
Return values
staticremove()
removes collection items
public
remove() : static
Return values
staticrequestUrl()
executes an http request
public
requestUrl(string $url[, string $method = 'GET' ][, array<string|int, mixed> $options = [] ]) : string|bool
Parameters
- $url : string
- $method : string = 'GET'
- $options : array<string|int, mixed> = []
Tags
Return values
string|boolreset()
resets collection
public
reset() : static
Return values
staticsave()
public
save() : static
Return values
staticwhere()
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
Return values
staticgetService()
gets registered service
protected
getService(string $service_key) : mixed
Parameters
- $service_key : string