ModelWhereAndJoinBuilder Class Reference

Inheritance diagram for ModelWhereAndJoinBuilder:
ModelJoinBuilder ReadOptimizationModelWhereAndJoinBuilder

Public Member Functions

 __construct (RedBeanModelAttributeToDataProviderAdapter $modelAttributeToDataProviderAdapter, RedBeanModelJoinTablesQueryAdapter $joinTablesAdapter, $setDistinct=false, $wherePartColumnModifierType=null)
 resolveJoinsAndBuildWhere ($operatorType, $value, &$clausePosition, &$where, $onTableAliasName=null, $resolveAsSubquery=false)

Protected Member Functions

 buildJoinAndWhereForRelatedAttribute ($operatorType, $value, $whereKey, &$where, $onTableAliasName=null, $resolveAsSubquery=false)
 resolveRelationAttributeTableAliasNameForResolveSubquery ($onTableAliasName, $resolveAsSubquery=false)
 resolveRelationAttributeTableAliasNameForResolveSubqueryAsTrue ($onTableAliasName)
 buildWhereForRelatedAttributeThatIsItselfAHasManyRelation ($onTableAliasName, $operatorType, $value, &$where, $whereKey)
 resolveJoinsForRelatedId ($onTableAliasName=null)
 addWherePartByClauseInformation ($operatorType, $value, &$where, $whereKey, $tableAliasName, $columnName)
 resolveWhereColumnContentForModifier ($tableAliasName, $columnName)
 resolveLeftJoinsForARelationAttribute ($onTableAliasName)
 resolveTimeZoneAdjustmentForACalculatedDateTimeModifier ()

Protected Attributes

 $wherePartColumnModifierType

Detailed Description

Builder for creating where clauses and making sure the appropriate joins are added to facilitate these clauses.

Definition at line 40 of file ModelWhereAndJoinBuilder.php.


Member Function Documentation

resolveJoinsAndBuildWhere ( operatorType,
value,
&$  clausePosition,
&$  where,
onTableAliasName = null,
resolveAsSubquery = false 
)
Parameters:
$operatorType 
$value 
$clausePosition 
$where 
null | string $onTableAliasName
boolean | $resolveAsSubquery

Reimplemented in ReadOptimizationModelWhereAndJoinBuilder.

Definition at line 64 of file ModelWhereAndJoinBuilder.php.

buildJoinAndWhereForRelatedAttribute ( operatorType,
value,
whereKey,
&$  where,
onTableAliasName = null,
resolveAsSubquery = false 
) [protected]

Given a related attribute on a model, build the join and where sql string information.

Parameters:
$operatorType 
$value 
$whereKey 
$where 
null | string $onTableAliasName

Definition at line 100 of file ModelWhereAndJoinBuilder.php.

buildWhereForRelatedAttributeThatIsItselfAHasManyRelation ( onTableAliasName,
operatorType,
value,
&$  where,
whereKey 
) [protected]

Given a related attribute on a model and the related attribute is a has_many relation, build the join and where sql string information.

Parameters:
$onTableAliasName 
$operatorType 
$value 
$where 
$whereKey 
Exceptions:
NotSupportedException 

Definition at line 182 of file ModelWhereAndJoinBuilder.php.

resolveJoinsForRelatedId ( onTableAliasName = null  )  [protected]
Parameters:
null | string $onTableAliasName
Returns:
null|string

Definition at line 228 of file ModelWhereAndJoinBuilder.php.

addWherePartByClauseInformation ( operatorType,
value,
&$  where,
whereKey,
tableAliasName,
columnName 
) [protected]

Add a sql string to the where array. How the sql string is built depends on if the value is a string or not.

Parameters:
$operatorType 
$value 
$where 
$whereKey 
$tableAliasName 
$columnName 

Definition at line 256 of file ModelWhereAndJoinBuilder.php.

resolveWhereColumnContentForModifier ( tableAliasName,
columnName 
) [protected]
Parameters:
$tableAliasName 
$columnName 
Returns:
string

Definition at line 278 of file ModelWhereAndJoinBuilder.php.

resolveLeftJoinsForARelationAttribute ( onTableAliasName  )  [protected]

//todo: this override method was needed because otherwise the conversation listview would blow up. The elseif was added to properly support owned relations since those should always run the addLeftJoin. I am not sure what else is affected by this method, but reporting can't really use this override since even if the attribute is not related, it doesn't mean we shouldn't do the left join. Further work needs to be done with this method to test things out. The starting point would be to test the conversation listview issue which is around the use of owner and then work out from there.

ZurmoModelDataProviderUtilTest breaks if we don't have the elseif, but ModulesSearchWithDataProviderTest breaks if we do and it breaks really bad.

Parameters:
$onTableAliasName 
Returns:
null|string

Reimplemented from ModelJoinBuilder.

Definition at line 305 of file ModelWhereAndJoinBuilder.php.

resolveTimeZoneAdjustmentForACalculatedDateTimeModifier (  )  [protected]
Returns:
string

Definition at line 322 of file ModelWhereAndJoinBuilder.php.


The documentation for this class was generated from the following file:
 All Data Structures Functions Variables
Generated on Sat Apr 29 07:10:26 2017