Methods

loadItems()

loadItems(\Charcoal\Source\StorableInterface|null  $item = null) : array

Parameters

\Charcoal\Source\StorableInterface|null $item

The item type to load.

Returns

array

saveItem()

saveItem(\Charcoal\Source\StorableInterface  $item) : mixed

Save an item (create a new row) in storage.

Parameters

\Charcoal\Source\StorableInterface $item

The object to save.

Returns

mixed —

The created item ID, or false in case of an error.

updateItem()

updateItem(\Charcoal\Source\StorableInterface  $item, array  $properties = null) : boolean

Update an item in storage.

Parameters

\Charcoal\Source\StorableInterface $item

The object to update.

array $properties

The list of properties to update, if not all.

Returns

boolean —

Success / Failure

deleteItem()

deleteItem(\Charcoal\Source\StorableInterface  $item = null) : boolean

Delete an item from storage

Parameters

\Charcoal\Source\StorableInterface $item

Optional item to delete. If none, the current model object will be used.

Returns

boolean —

Success / Failure

setProperties()

setProperties(array  $properties) : \Charcoal\Source\ColelectionLoader

Parameters

array $properties

The properties.

Returns

\Charcoal\Source\ColelectionLoader —

Chainable

properties()

properties() : array

Returns

array

addProperty()

addProperty(string  $property) : \Charcoal\Source\CollectionLoader

Parameters

string $property

Property ident.

Returns

\Charcoal\Source\CollectionLoader —

Chainable

setFilters()

setFilters(array  $filters) : \Charcoal\Source\Collection

Parameters

array $filters

The filters.

Returns

\Charcoal\Source\Collection —

Chainable

filters()

filters() : array

Returns

array

addFilter()

addFilter(string|array|\Charcoal\Source\Filter  $param, mixed  $val = null, array  $options = null) : \Charcoal\Source\CollectionLoader

Add a collection filter to the loader.

Parameters

string|array|\Charcoal\Source\Filter $param

The filter parameter. May the "filter property" or an array / object.

mixed $val

Optional. Val, only used if the first argument is a string.

array $options

Optional. Options, only used if the first argument is a string.

Returns

\Charcoal\Source\CollectionLoader —

(Chainable)

setOrders()

setOrders(array  $orders) : \Charcoal\Source\CollectionLoader

Parameters

array $orders

The orders.

Returns

\Charcoal\Source\CollectionLoader —

Chainable

orders()

orders() : array

Returns

array

addOrder()

addOrder(string|array|\Charcoal\Source\Order  $param, string  $mode = 'asc', array  $options = null) : \Charcoal\Source\CollectionLoader

Parameters

string|array|\Charcoal\Source\Order $param

The order parameter. May the "order property" or an array / object.

string $mode

Optional. Mode, only used if the first argument is a string.

array $options

Optional. Options, only user if the first argument is a string.

Returns

\Charcoal\Source\CollectionLoader —

Chainable

setPagination()

setPagination(mixed  $param) : \Charcoal\Source\CollectionLoader

Parameters

mixed $param

The pagination information.

Returns

\Charcoal\Source\CollectionLoader —

Chainable

setPage()

setPage(integer  $page) : \Charcoal\Source\CollectionLoader

Parameters

integer $page

The page number. Starts with 0.

Returns

\Charcoal\Source\CollectionLoader —

Chainable

page()

page() : integer

Returns

integer

setNumPerPage()

setNumPerPage(integer  $num) : \Charcoal\Source\CollectionLoader

Parameters

integer $num

The number of item to retrieve per page.

Returns

\Charcoal\Source\CollectionLoader —

Chainable

numPerPage()

numPerPage() : integer

Returns

integer