RedBeanModelsDataProvider Class Reference

Inheritance diagram for RedBeanModelsDataProvider:

Public Member Functions

 __construct ($id, array $modelClassNamesAndSortAttributes=null, $sortDescending=false, array $modelClassNamesAndSearchAttributeData=null, array $config=array())
 getSort ()
 calculateTotalItemCount ()

Static Public Member Functions

static makeUnionSql (array $modelClassNamesAndSearchAttributeData, array $modelClassNamesAndSortAttributes=null, $sortDescending=false, $offset=null, $limit=null)

Protected Member Functions

 fetchData ()
 makeModelsBySql ($sql)
 fetchKeys ()

Static Protected Member Functions

static makeSubsetUnionSqlQuery ($sqlStatementsToUnion, $offset=null, $count=null, $orderBy=null)

Detailed Description

A data provider that returns models that are from one or more model classes.

Definition at line 40 of file RedBeanModelsDataProvider.php.

Constructor & Destructor Documentation

__construct ( id,
array $  modelClassNamesAndSortAttributes = null,
sortDescending = false,
array $  modelClassNamesAndSearchAttributeData = null,
array $  config = array() 
string $id - unique identifier for this data collection.
array $modelClassNamesAndSortAttributes
boolean $sortDescending
array $modelClassNamesAndSearchAttributeData. Array of model class names and search attributes. This supports multiple arrays of the same model class names whereas modelClassNamesAndSortAttributes does not support that. Example:

                $modelClassNamesAndSortAttributes = array(array('ModelA' => array('attributeA' => 'value'))
                                                          array('ModelB' => array('attributeB' => 'value')));
array $config

Definition at line 62 of file RedBeanModelsDataProvider.php.

Member Function Documentation

fetchData (  )  [protected]

See the yii documentation.

Definition at line 85 of file RedBeanModelsDataProvider.php.

static makeUnionSql ( array $  modelClassNamesAndSearchAttributeData,
array $  modelClassNamesAndSortAttributes = null,
sortDescending = false,
offset = null,
limit = null 
) [static]

Public for testing purposes only.

Reimplemented in AutoresponderRedBeanModelsDataProvider.

Definition at line 112 of file RedBeanModelsDataProvider.php.

makeModelsBySql ( sql  )  [protected]

Given a unioned sql statement, make the models for the beans returned. The modelClassName is a column name that must be in the select part of the sql statement for each unioned select.

string $sql
array of models

Definition at line 169 of file RedBeanModelsDataProvider.php.

getSort (  ) 
CSort the sorting object. Sorting using getSort is disabled.

Definition at line 219 of file RedBeanModelsDataProvider.php.

calculateTotalItemCount (  ) 

This function is made public for unit testing. Calculates the total for each of the select statements and adds them up. Setting $selectDistinct to true when calling getCount since this is always true when counting ids.

integer - total count across select statements.

Definition at line 230 of file RedBeanModelsDataProvider.php.

fetchKeys (  )  [protected]

See the yii documentation.

Definition at line 248 of file RedBeanModelsDataProvider.php.

The documentation for this class was generated from the following file:
 All Data Structures Functions Variables
Generated on Fri Nov 15 07:11:06 2019