- 
            DocsBackend- 
            Behaviors
- 
            Classes
- 
            Controllers
- 
            Database- 
            Seeds
 
- 
            
- 
            Facades
- 
            FormWidgets
- 
            Helpers- 
            Exception
- Backend
 
- 
            
- 
            Models
- 
            ReportWidgets
- 
            Skins
- 
            Traits
- 
            Widgets
- ServiceProvider
 
- 
            
- 
            Cms- 
            Classes- Asset
- AutoDatasource
- CmsCompoundObject
- CmsController
- CmsException
- CmsObject
- CmsObjectCollection
- CodeBase
- CodeParser
- ComponentBase
- ComponentHelpers
- ComponentManager
- ComponentPartial
- Content
- Controller
- Layout
- LayoutCode
- MediaLibrary
- MediaLibraryItem
- MediaViewHelper
- Meta
- ObjectMemoryCache
- Page
- PageCode
- Partial
- PartialCode
- PartialStack
- Router
- Theme
- ThemeManager
 
- 
            Components
- 
            Contracts
- 
            Controllers
- 
            Facades
- 
            FormWidgets
- 
            Helpers
- 
            Models
- 
            ReportWidgets
- 
            Traits
- 
            Twig- ComponentNode
- ComponentTokenParser
- ContentNode
- ContentTokenParser
- DebugExtension
- DefaultNode
- DefaultTokenParser
- Extension
- FlashNode
- FlashTokenParser
- FrameworkNode
- FrameworkTokenParser
- Loader
- PageNode
- PageTokenParser
- PartialNode
- PartialTokenParser
- PlaceholderNode
- PlaceholderTokenParser
- PutNode
- PutTokenParser
- ScriptsNode
- ScriptsTokenParser
- StylesNode
- StylesTokenParser
 
- 
            Widgets
- ServiceProvider
 
- 
            
- 
            System- 
            Behaviors
- 
            Classes
- 
            Console
- 
            Controllers
- 
            Database
- 
            Helpers
- 
            Models
- 
            ReportWidgets
- 
            Traits
- 
            Twig
- ServiceProvider
 
- 
            
- 
            Events- 
            backend- 
            ajax
- 
            filter
- 
            form
- 
            list
- 
            menu
- 
            page
- 
            user
 
- 
            
- 
            cms- 
            ajax
- 
            block
- 
            combiner
- 
            component
- 
            object
- 
            page
- 
            router
- 
            template
- 
            theme
 
- 
            
- 
            halcyon- 
            datasource
 
- 
            
- 
            mailer
- 
            media
- 
            model
- 
            system- 
            assets
- 
            console- 
            mirror
- 
            theme
 
- 
            
- 
            reportwidgets
- 
            settings
- extendConfigFile
 
- 
            
- 
            translator
 
- 
            
- 
            Library- 
            Argon
- 
            Auth- 
            Models
- AuthException
- Manager
 
- 
            
- 
            Config
- 
            Cookie- 
            Middleware
 
- 
            
- 
            Database- 
            Attach
- 
            Behaviors
- 
            Concerns
- 
            Connections
- 
            Connectors
- 
            Models
- 
            Relations
- 
            Schema
- 
            Traits
- 
            Updates
- README
- Builder
- Collection
- DatabaseServiceProvider
- DataFeed
- Dongle
- MemoryCache
- Model
- ModelBehavior
- ModelException
- NestedTreeScope
- Pivot
- QueryBuilder
- SortableScope
- TreeCollection
- Updater
 
- 
            
- 
            Events
- 
            Exception
- 
            Extension
- 
            Filesystem
- 
            Flash
- 
            Foundation- 
            Bootstrap
- 
            Console
- 
            Exception
- 
            Http- 
            Middleware
- Kernel
 
- 
            
- 
            Providers
- Application
- Maker
 
- 
            
- 
            Halcyon- 
            Datasource
- 
            Exception
- 
            Processors
- 
            Traits
- README
- Builder
- Collection
- HalcyonServiceProvider
- MemoryCacheManager
- MemoryRepository
- Model
 
- 
            
- 
            Html
- 
            Mail
- 
            Network
- 
            Parse
- 
            Router
- 
            Scaffold
- 
            Support
- 
            Translation
 
- 
            
- Documentation
- API
- Backend
- Widgets
- Table
- ServerEventDataSource
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
- protected string $keyColumn - defined in Backend\Widgets\Table\DataSourceBase. Specifies a name of record's key column.
- protected integer $offset - defined in Backend\Widgets\Table\DataSourceBase. Internal record offset.
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
Inherited public methods
- public void construct(string $keyColumn='id') - defined in Backend\Widgets\Table\DataSourceBase. Class constructor.
- public array readRecords(integer $count=10) - defined in Backend\Widgets\Table\DataSourceBase. Returns a set of records from the data source.
- public void reset() - defined in Backend\Widgets\Table\DataSourceBase. Rewinds the the data source to the first record.
Protected methods
protected array emitterEventSortEvents(string $eventName)
Sort the listeners for a given event by priority.
Parameters
- string $eventName
