Backend\Widgets\Table\ServerEventDataSource

Source: ~/modules/backend/widgets/table/ServerEventDataSource.php

Extends:

The server-event data source for the Table widget.

Protected properties

protected array $emitterSingleEventCollection

Collection of registered events to be fired once only.

protected array $emitterEventCollection

Collection of registered events.

protected array $emitterEventSorted

Sorted collection of events.

Show inherited protected properties

Inherited protected properties

Public methods

public self bindEvent($event, $callback, $priority=0)

Create a new event binding.

Parameters
  • $event
  • $callback
  • $priority

public self bindEventOnce($event, $callback)

Create a new event binding that fires once only

Parameters
  • $event
  • $callback

public void createRecord($data, $placement, $relativeToKey)

Updates a record in the data source.

Parameters
  • $data
  • $placement
  • $relativeToKey

public array deleteRecord($key)

Removes a record from the data source.

Parameters
  • $key

public array fireEvent(string $event, array $params=array(), boolean $halt=false)

Fire an event and call the listeners.

Parameters
  • string $event - Event name
  • array $params - Event parameters
  • boolean $halt - Halt after first non-null result

public void getAllRecords()

Returns all records in the data source. This method is specific only for the client memory data sources.

public integer getCount()

Returns a total number of records in the data source.

public array getRecords(integer $offset, integer $count)

Return records from the data source.

Parameters
  • integer $offset - Specifies the offset of the first record to return, zero-based.
  • integer $count - Specifies the number of records to return.

public void initRecords(array $records)

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.

Parameters
  • array $records - Records to initialize in the data source.

public void purge()

Removes all records from the data source.

public void searchRecords($query, $offset, $count)

Identical to getRecords except provided with a search query.

Parameters
  • $query
  • $offset
  • $count

public self unbindEvent(string $event=NULL)

Destroys an event binding.

Parameters
  • string $event - Event to destroy

public void updateRecord($key, $data)

Updates a record in the data source.

Parameters
  • $key
  • $data

Show inherited public methods

Inherited public methods

Protected methods

protected array emitterEventSortEvents(string $eventName)

Sort the listeners for a given event by priority.

Parameters
  • string $eventName