trait XQLCollectionTrait

Methods

applyXQLFilter(XQL $XQL, ParameterObject|null $parameterObject = null)

No description

applyXQLPagination(XQL $XQL)

Apply XQL Pagination to current Collection

array
getAPIResult(ParameterObject|null $parameterObject = null, PartitionQuery|null $partitionQuery = null)

Fullfill API Request and return result

static ParameterObject
getWebserviceParameterObject()

Get generic description of collection for webservice API

static Closure
getXQLReferenceClosure(Collection $referenceCollection, string $expandToProperty = null, string $referenceKeyField = null)

Returns a closure that adds an AfterLoadListener to filter elements of a reference collection and attach them as expand property to this collection, e.g. articles referencing to user by user_id

array
getXQLResult(XQL|null $XQL, string|null $partitionColumn = null, bool $hasManyRelation = true)

Apply XELOS Query Language Object

  • [Optional] Apply $filter
  • [Optional] Apply $pagination
  • [Optional] Populate $expand
  • [Optional] Remove fields which are not required by $select

populateApiProperties(ParameterObject|null $parameterObject = null)

Map internal collection information to fulfill the promised ParameterObject

Details

at line 36
protected XQLCollectionTrait applyXQLFilter(XQL $XQL, ParameterObject|null $parameterObject = null)

No description

Parameters

XQL $XQL
ParameterObject|null $parameterObject

Return Value

XQLCollectionTrait

at line 82
protected XQLCollectionTrait applyXQLPagination(XQL $XQL)

Apply XQL Pagination to current Collection

Return information / stats about applied pagination

Parameters

XQL $XQL

Return Value

XQLCollectionTrait

at line 215
array getAPIResult(ParameterObject|null $parameterObject = null, PartitionQuery|null $partitionQuery = null)

Fullfill API Request and return result

Parameters

ParameterObject|null $parameterObject
PartitionQuery|null $partitionQuery

Return Value

array

at line 26
static ParameterObject getWebserviceParameterObject()

Get generic description of collection for webservice API

Return Value

ParameterObject

at line 304
static protected Closure getXQLReferenceClosure(Collection $referenceCollection, string $expandToProperty = null, string $referenceKeyField = null)

Returns a closure that adds an AfterLoadListener to filter elements of a reference collection and attach them as expand property to this collection, e.g. articles referencing to user by user_id

Parameters

Collection $referenceCollection

the collection referenced by this collection, e.g. users referenced as authors of articles

string $expandToProperty

overwrite the name of the expand property, default is the model name, e.g. user_Expand for a user collection

string $referenceKeyField

overwrite field name if referencing collection does not use standard fields, e.g. created_by instead of user_id in forum posts

Return Value

Closure

at line 124
final array getXQLResult(XQL|null $XQL, string|null $partitionColumn = null, bool $hasManyRelation = true)

Apply XELOS Query Language Object

  • [Optional] Apply $filter
  • [Optional] Apply $pagination
  • [Optional] Populate $expand
  • [Optional] Remove fields which are not required by $select

Parameters

XQL|null $XQL
string|null $partitionColumn
bool $hasManyRelation

If true, we expect there to be {0,n} results per column (1:n relationship) and return a collection result. If false, we expect a 1:1 relationship and return a single result or null

Return Value

array

at line 293
protected XQLCollectionTrait populateApiProperties(ParameterObject|null $parameterObject = null)

Map internal collection information to fulfill the promised ParameterObject

Parameters

ParameterObject|null $parameterObject

Return Value

XQLCollectionTrait