Backend\Widgets\Table\ServerEventDataSource
Overview
The server-event data source for the Table widget.
Extends
Protected Properties
protected array $emitterSingleEventCollection
emitterSingleEventCollection of events to be fired once only
protected array $emitterEventCollection
emitterEventCollection of all registered events
protected array $emitterEventSorted
emitterEventSorted collection
Show inherited protected properties
Inherited Protected Properties
- $keyColumn - Specifies a name of record's key column. (defined in Backend\Widgets\Table\DataSourceBase)
- $offset - Internal record offset. (defined in Backend\Widgets\Table\DataSourceBase)
Public Methods
public bindEvent()
public bindEvent($event, $callback, $priority = 0): void
bindEvent creates a new event binding
public bindEventOnce()
public bindEventOnce($event, $callback, $priority = 0): void
bindEventOnce creates a new event binding that fires once only
public createRecord()
public createRecord($data, $placement, $relativeToKey): void
Updates a record in the data source.
public deleteRecord()
public deleteRecord($key): array
Removes a record from the data source.
public fireEvent()
public fireEvent(
string $event,
array $params = [],
boolean $halt = false
): array
fireEvent and call the listeners
public getAllRecords()
public getAllRecords(): void
Returns all records in the data source. This method is specific only for the client memory data sources.
public getCount()
public getCount(): integer
Returns a total number of records in the data source.
public getRecords()
public getRecords(integer $offset, integer $count): array
Return records from the data source.
public initRecords()
public initRecords(array $records): void
Initializes records in the data source. The method doesn't replace existing records and could be called multiple times in order to fill the data source.
public purge()
public purge(): void
Removes all records from the data source.
public searchRecords()
public searchRecords($query, $offset, $count): void
Identical to getRecords except provided with a search query.
public unbindEvent()
public unbindEvent($event = null): void
unbindEvent destroys an event binding
public updateRecord()
public updateRecord($key, $data): void
Updates a record in the data source.
Inherited Public Methods
- construct() - Class constructor. (defined in Backend\Widgets\Table\DataSourceBase)
- readRecords() - Returns a set of records from the data source. (defined in Backend\Widgets\Table\DataSourceBase)
- reset() - Rewinds the the data source to the first record. (defined in Backend\Widgets\Table\DataSourceBase)
Protected Methods
protected emitterEventSortEvents()
protected emitterEventSortEvents($eventName, $combined = []): array
emitterEventSortEvents sorts the listeners for a given event by priority