RedBeanModelsDataProvider Class Reference

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() 
)
Parameters:
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:

            <?php
                $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.

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.

Parameters:
string $sql
Returns:
array of models

Definition at line 171 of file RedBeanModelsDataProvider.php.

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

Definition at line 221 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.

Returns:
integer - total count across select statements.

Definition at line 232 of file RedBeanModelsDataProvider.php.

fetchKeys (  )  [protected]

See the yii documentation.

Definition at line 250 of file RedBeanModelsDataProvider.php.


The documentation for this class was generated from the following file:
 All Data Structures Functions Variables
Generated on Sun Nov 19 07:10:28 2017