RedBeanModelDataProvider Class Reference

Inheritance diagram for RedBeanModelDataProvider:
EmptyRedBeanModelDataProvider LeaderboardDataProvider RedBeanModelByRelatedModelDataProvider StarredModelDataProvider

Public Member Functions

 __construct ($modelClassName, $sortAttribute=null, $sortDescending=false, array $searchAttributeData=array(), array $config=array())
 getModelClassName ()
 setOffset ($offset)
 getSort ()
 calculateTotalItemCount ()

Static Public Member Functions

static resolveSortAttributeColumnName ($modelClassName, &$joinTablesAdapter, $sortAttribute)
static getSortAttributeName ($modelClassName)
static makeWhere ($modelClassName, array $metadata, &$joinTablesAdapter)

Protected Member Functions

 fetchData ()
 fetchKeys ()
 resolveExtraSql (RedBeanModelJoinTablesQueryAdapter &$joinTablesAdapter, &$where)

Protected Attributes


Detailed Description

A data provider that returns models.

Definition at line 40 of file RedBeanModelDataProvider.php.

Constructor & Destructor Documentation

__construct ( modelClassName,
sortAttribute = null,
sortDescending = false,
array $  searchAttributeData = array(),
array $  config = array() 

- Currently supports only non-related attributes.

Definition at line 52 of file RedBeanModelDataProvider.php.

Member Function Documentation

setOffset ( offset  ) 

Override the offset value that comes from the pagination object if needed. Used by sticky search for example when retrieving a sticky list in the detail view of a model.

integer $offset

Definition at line 83 of file RedBeanModelDataProvider.php.

fetchData (  )  [protected]

If the count query results in 0, the data query will not be run and an empty array will be returned. This helps to reduce queries to the database. See the yii documentation.

Reimplemented in EmptyRedBeanModelDataProvider, and LeaderboardDataProvider.

Definition at line 94 of file RedBeanModelDataProvider.php.

static getSortAttributeName ( modelClassName  )  [static]

Each model has a sort attribute that is used to order the models if none is specified.

Definition at line 177 of file RedBeanModelDataProvider.php.

getSort (  ) 
CSort the sorting object. If this is false, it means the sorting is disabled.

Definition at line 196 of file RedBeanModelDataProvider.php.

static makeWhere ( modelClassName,
array $  metadata,
&$  joinTablesAdapter 
) [static]

Not for use by applications. Public for unit tests only. Override from RedBeanModelDataProvider to support multiple where clauses for the same attribute and operatorTypes

metadata - array expected to have clauses and structure elements
See also:

Reimplemented in RedBeanModelByRelatedModelDataProvider.

Definition at line 214 of file RedBeanModelDataProvider.php.

calculateTotalItemCount (  ) 

See the yii documentation. This function is made public for unit testing. Setting $selectDistinct to true since the count should always be on unique ids

Reimplemented in LeaderboardDataProvider.

Definition at line 223 of file RedBeanModelDataProvider.php.

fetchKeys (  )  [protected]

See the yii documentation.

Reimplemented in LeaderboardDataProvider.

Definition at line 235 of file RedBeanModelDataProvider.php.

resolveExtraSql ( RedBeanModelJoinTablesQueryAdapter &$  joinTablesAdapter,
&$  where 
) [protected]

Override to add extra where option to the sql

RedBeanModelJoinTablesQueryAdapter $joinTablesAdapter
type $where

Reimplemented in StarredModelDataProvider.

Definition at line 250 of file RedBeanModelDataProvider.php.

The documentation for this class was generated from the following file:
 All Data Structures Functions Variables
Generated on Sun Sep 22 07:11:07 2019