All Data Structures Functions Variables Pages
Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions
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$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')));

Definition at line 62 of file RedBeanModelsDataProvider.php.

Member Function Documentation

fetchData ( )

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 

Public for testing purposes only.

Definition at line 112 of file RedBeanModelsDataProvider.php.

makeModelsBySql (   $sql)

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.

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

See the yii documentation.

Definition at line 248 of file RedBeanModelsDataProvider.php.

The documentation for this class was generated from the following file:
Generated on Fri Jun 5 2020 07:11:00