Documentation

Datasource
in package
Uses Emitter

Datasource base class.

Table of Contents

$emitterEventCollection  : array<string|int, mixed>
$emitterEventSorted  : array<string|int, mixed>
$emitterSingleEventCollection  : array<string|int, mixed>
$forceDeleting  : bool
$postProcessor  : Processor
The query post processor implementation.
bindEvent()  : self
Create a new event binding.
bindEventOnce()  : self
Create a new event binding that fires once only
fireEvent()  : array<string|int, mixed>
Fire an event and call the listeners.
forceDelete()  : void
Force the deletion of a record against the datasource
getPostProcessor()  : Processor
Get the query post processor used by the connection.
makeCacheKey()  : mixed
Generate a cache key unique to this datasource.
unbindEvent()  : self
Destroys an event binding.
emitterEventSortEvents()  : array<string|int, mixed>
Sort the listeners for a given event by priority.

Properties

$emitterEventCollection

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

Collection of registered events.

$emitterEventSorted

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

Sorted collection of events.

$emitterSingleEventCollection

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

Collection of registered events to be fired once only.

$forceDeleting

protected bool $forceDeleting = false

Indicates if the record is currently being force deleted.

Methods

bindEvent()

Create a new event binding.

public bindEvent(mixed $event, mixed $callback, mixed $priority) : self
Parameters
$event : mixed
$callback : mixed
$priority : mixed
Return values
self

bindEventOnce()

Create a new event binding that fires once only

public bindEventOnce(mixed $event, mixed $callback) : self
Parameters
$event : mixed
$callback : mixed
Return values
self

fireEvent()

Fire an event and call the listeners.

public fireEvent(string $event[, array<string|int, mixed> $params = [] ][, bool $halt = false ]) : array<string|int, mixed>
Parameters
$event : string

Event name

$params : array<string|int, mixed> = []

Event parameters

$halt : bool = false

Halt after first non-null result

Return values
array<string|int, mixed>

Collection of event results / Or single result (if halted)

forceDelete()

Force the deletion of a record against the datasource

public forceDelete(string $dirName, string $fileName, string $extension) : void
Parameters
$dirName : string
$fileName : string
$extension : string
Return values
void

makeCacheKey()

Generate a cache key unique to this datasource.

public makeCacheKey([mixed $name = '' ]) : mixed
Parameters
$name : mixed = ''
Return values
mixed

unbindEvent()

Destroys an event binding.

public unbindEvent([string $event = null ]) : self
Parameters
$event : string = null

Event to destroy

Return values
self

emitterEventSortEvents()

Sort the listeners for a given event by priority.

protected emitterEventSortEvents(string $eventName) : array<string|int, mixed>
Parameters
$eventName : string
Return values
array<string|int, mixed>

Search results