Methods summary
abstract protected
array
|
#
fetchData( )
Fetches the data from the persistent data storage.
Fetches the data from the persistent data storage.
Returns
array list of data items
|
abstract protected
array
|
#
fetchKeys( )
Fetches the data item keys from the persistent data storage.
Fetches the data item keys from the persistent data storage.
Returns
array list of data item keys.
|
abstract protected
integer
|
#
calculateTotalItemCount( )
Calculates the total number of data items.
Calculates the total number of data items.
Returns
integer the total number of data items.
|
public
string
|
#
getId( )
Returns the ID that uniquely identifies the data provider.
Returns the ID that uniquely identifies the data provider.
Returns
string the unique ID that uniquely identifies the data provider among all data
providers.
Implementation of
|
public
|
#
setId( string $value )
Sets the provider ID.
Parameters
- $value
string $value the unique ID that uniquely identifies the data provider among all data
providers.
|
public
CSort |false
|
#
getSort( string $className = 'CSort' )
Returns the sort object.
Parameters
- $className
string $className the sorting object class name. Parameter is available since version
1.1.13.
Returns
CSort |false
the sorting object. If this is false, it means the sorting is disabled.
Implementation of
|
public
|
#
setSort( mixed $value )
Sets the sorting for this data provider.
Sets the sorting for this data provider.
Parameters
- $value
mixed $value the sorting to be used by this data provider. This could be a CSort object or an array used to configure the sorting object. If this is
false, it means the sorting should be disabled. You can configure this property
same way as a component: <pre> array( 'class' => 'MySort', 'attributes'
=> array('name', 'weight'), ), </pre>
|
public
array
|
#
getData( boolean $refresh = false )
Returns the data items currently available.
Returns the data items currently available.
Parameters
- $refresh
boolean $refresh whether the data should be re-fetched from persistent storage.
Returns
array the list of data items currently available in this data provider.
Implementation of
|
public
|
#
setData( array $value )
Sets the data items for this provider.
Sets the data items for this provider.
Parameters
- $value
array $value put the data items into this provider.
|
public
array
|
#
getKeys( boolean $refresh = false )
Returns the key values associated with the data items.
Returns the key values associated with the data items.
Parameters
- $refresh
boolean $refresh whether the keys should be re-calculated.
Returns
array the list of key values corresponding to data. Each data item in data is uniquely identified by the corresponding key value in this array.
Implementation of
|
public
|
#
setKeys( array $value )
Sets the data item keys for this provider.
Sets the data item keys for this provider.
Parameters
- $value
array $value put the data item keys into this provider.
|
public
integer
|
#
getItemCount( boolean $refresh = false )
Returns the number of data items in the current page. This is equivalent to
<span class="php-keyword2">count</span>(<span
class="php-var">$provider</span>->getData()) . When pagination is set false, this returns the same value as totalItemCount.
Returns the number of data items in the current page. This is equivalent to
<span class="php-keyword2">count</span>(<span
class="php-var">$provider</span>->getData()) . When pagination is set false, this returns the same value as totalItemCount.
Parameters
- $refresh
boolean $refresh whether the number of data items should be re-calculated.
Returns
integer the number of data items in the current page.
Implementation of
|
public
integer
|
#
getTotalItemCount( boolean $refresh = false )
Returns the total number of data items. When pagination is set false,
this returns the same value as itemCount.
Returns the total number of data items. When pagination is set false,
this returns the same value as itemCount.
Parameters
- $refresh
boolean $refresh whether the total number of data items should be re-calculated.
Returns
integer total number of possible data items.
Implementation of
|
public
|
|
Magic properties summary
public
string
|
$id
|
#
The unique ID that uniquely identifies the data provider among all data
providers.
The unique ID that uniquely identifies the data provider among all data
providers.
|
public
CSort
|
$sort
|
#
The sorting object. If this is false, it means the sorting is disabled.
The sorting object. If this is false, it means the sorting is disabled.
|
public
array
|
$data
|
#
The list of data items currently available in this data provider.
The list of data items currently available in this data provider.
|
public
array
|
$keys
|
#
The list of key values corresponding to data. Each data item in
data is uniquely identified by the corresponding key value in this
array.
The list of key values corresponding to data. Each data item in
data is uniquely identified by the corresponding key value in this
array.
|
public
integer
|
$itemCount
|
#
The number of data items in the current page.
The number of data items in the current page.
|
public
integer
|
$totalItemCount
|
#
Total number of possible data items.
Total number of possible data items.
|