ClientMemoryDataSource
The client-memory data source for the Table widget.
class Backend\Widgets\Table\ClientMemoryDataSource
extends Backend\Widgets\Table\DataSourceBase
Extends
Class | Description |
---|---|
DataSourceBase
|
Base class for the Table widget data sources. |
Properties
protected
$data
:
array
= []
Keeps the data source data.
inherited protected $keyColumn : string
Specifies a name of record's key column
inherited protected $offset : int
Internal record offset
Methods
public getAllRecords ()
Returns all records in the data source.
This method is specific only for the client memory data sources.
public getCount () : int
Returns a total number of records in the data source.
public getRecords (int $offset, int $count) : array
Return records from the data source.
Property | Type | Description |
---|---|---|
$offset | int |
int
Specifies the offset of the first record to return, zero-based. |
$count | int |
int
Specifies the number of records to return. |
Returns the records. If there are no more records, returns an empty array.
public 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.
Property | Type | Description |
---|---|---|
$records | array |
array
Records to initialize in the data source. |
public purge ()
Removes all records from the data source.
inherited
public
construct (string $keyColumn = "id"
)
Class constructor.
Property | Type | Description |
---|---|---|
$keyColumn | string |
string
Specifies a name of the key column. |
inherited
public
readRecords (integer $count = 10
)
: array
Returns a set of records from the data source.
Property | Type | Description |
---|---|---|
$count | integer |
integer
Specifies the number of records to return. |
Returns the records. If there are no more records, returns an empty array.
inherited public reset ()
Rewinds the the data source to the first record.
Use this method with the readRecords() method.
inherited public searchRecords ($query, $offset, $count)
Identical to getRecords except provided with a search query.
Property | Type | Description |
---|---|---|
$query | mixed |
mixed
|
$offset | mixed |
mixed
|
$count | mixed |
mixed
|