RedBeanModelAttributeToDataProviderAdapter Class Reference

Inheritance diagram for RedBeanModelAttributeToDataProviderAdapter:
DerivedRelationViaCastedUpRedBeanModelAttributeToDataProviderAdapter InferredRedBeanModelAttributeToDataProviderAdapter OwnedSecurableItemIdToDataProviderAdapter ReadOptimizationDerivedAttributeToDataProviderAdapter

Public Member Functions

 __construct ($modelClassName, $attribute, $relatedAttribute=null)
 setCastingHintModelClassNameForAttribute ($castingHintAttributeModelClassName)
 getCastingHintModelClassNameForAttribute ()
 setCastingHintStartingModelClassName ($castingHintStartingModelClassName)
 getResolvedModelClassName ()
 getModelClassName ()
 getAttribute ()
 getRelatedAttribute ()
 getModelTableName ()
 getAttributeModelClassName ()
 getAttributeTableName ()
 getModel ()
 getColumnName ()
 getColumnNameByPosition ($attributePosition)
 isRelation ()
 getRelationType ()
 isOwnedRelation ()
 isRelationTypeAHasManyVariant ()
 isRelationTypeAHasOneVariant ()
 hasRelatedAttribute ()
 getRelationModelClassName ()
 getRelatedAttributeModelClassName ()
 canRelationHaveTable ()
 getRelationTableName ()
 getRelationModelClassNameThatCanHaveATable ()
 getRelatedAttributeTableName ()
 getRelatedAttributeColumnName ()
 getRelatedAttributeColumnNameByPosition ($attributePosition)
 isRelatedAttributeRelation ()
 getRelatedAttributeRelationType ()
 getRelatedAttributeRelationModelClassName ()
 getManyToManyTableName ()
 isAttributeMixedIn ()
 isAttributeOnDifferentModel ()
 resolveManyToManyColumnName ()
 isAttributeDerivedRelationViaCastedUpModel ()
 getCastedUpModelClassNameForDerivedRelation ()
 getManyToManyTableNameForDerivedRelationViaCastedUpModel ()
 getOpposingRelationModelClassName ()
 getDerivedRelationViaCastedUpModelClassName ()
 getOpposingRelationTableName ()
 isDerivedRelationViaCastedUpModelDifferentThanOpposingModelClassName ()
 isInferredRelation ()
 sortUsesTwoAttributes ()
 relatedAttributesSortUsesTwoAttributes ()

Protected Member Functions

 getRelationModel ()

Protected Attributes

 $modelClassName
 $attribute
 $relatedAttribute
 $model
 $castingHintAttributeModelClassName
 $castingHintStartingModelClassName

Detailed Description

Adapts RedBeanModel information based on a specific model attribute, and optionally a specific related attribute into data provider ready information.

Definition at line 41 of file RedBeanModelAttributeToDataProviderAdapter.php.


Constructor & Destructor Documentation

__construct ( modelClassName,
attribute,
relatedAttribute = null 
)
Parameters:
string $modelClassName
string $attribute
string $relatedAttribute

Reimplemented in OwnedSecurableItemIdToDataProviderAdapter, and ReadOptimizationDerivedAttributeToDataProviderAdapter.

Definition at line 82 of file RedBeanModelAttributeToDataProviderAdapter.php.


Member Function Documentation

setCastingHintModelClassNameForAttribute ( castingHintAttributeModelClassName  ) 

Utilizing casting hint to ensure a castUp or castDown procedure done in ModelJoinBuilder for example does not cast too far down or up when looking for the end node of a relation. For example, if you are coming from meeting into account via activityItems, but the final attribute is owner, then you don't need to cast all the way down to account.

Parameters:
string $castingHintAttributeModelClassName

Definition at line 100 of file RedBeanModelAttributeToDataProviderAdapter.php.

getCastingHintModelClassNameForAttribute (  ) 
Returns:
string

Definition at line 109 of file RedBeanModelAttributeToDataProviderAdapter.php.

setCastingHintStartingModelClassName ( castingHintStartingModelClassName  ) 
Parameters:
string|null $castingHintStartingModelClassName

Definition at line 117 of file RedBeanModelAttributeToDataProviderAdapter.php.

getResolvedModelClassName (  ) 

Resolves what the model class name is to use as the starting point. For cast hinting it is possible the starting model class name is already casted up, therefore casting up further is not required.

See also:
setCastingHintModelClassNameForAttribute
Returns:
string

Definition at line 129 of file RedBeanModelAttributeToDataProviderAdapter.php.

getModelTableName (  ) 
Returns:
The table name for the model class name specified in this adapter.

Definition at line 156 of file RedBeanModelAttributeToDataProviderAdapter.php.

getAttributeModelClassName (  ) 
Returns:
The model class name for the attribute specified in this adapter. Since the attribute might not be on the same model as the model class name specified, (might be casted up) this method is needed.

Reimplemented in OwnedSecurableItemIdToDataProviderAdapter, and ReadOptimizationDerivedAttributeToDataProviderAdapter.

Definition at line 166 of file RedBeanModelAttributeToDataProviderAdapter.php.

getAttributeTableName (  ) 
Returns:
The table name for the attribute specified in this adapter. Since the attribute might not be on the same table as the model class name specified, this method is needed.

Definition at line 180 of file RedBeanModelAttributeToDataProviderAdapter.php.

getColumnName (  ) 
Returns:
The column name for the attribute specified in this adapter.

Reimplemented in OwnedSecurableItemIdToDataProviderAdapter, and ReadOptimizationDerivedAttributeToDataProviderAdapter.

Definition at line 198 of file RedBeanModelAttributeToDataProviderAdapter.php.

getColumnNameByPosition ( attributePosition  ) 
Returns:
string The column name for the attribute to be used in the sort by the attribute specified in this adapater based on the position in the array returned by getSortAttributesByAttribute

Definition at line 209 of file RedBeanModelAttributeToDataProviderAdapter.php.

isRelation (  ) 
Returns:
true/false - Is the attribute a relation on the model class name.

Reimplemented in OwnedSecurableItemIdToDataProviderAdapter, and ReadOptimizationDerivedAttributeToDataProviderAdapter.

Definition at line 224 of file RedBeanModelAttributeToDataProviderAdapter.php.

getRelationType (  ) 
Returns:
The relation type of the attribute on the model class name.

Reimplemented in OwnedSecurableItemIdToDataProviderAdapter, and ReadOptimizationDerivedAttributeToDataProviderAdapter.

Definition at line 233 of file RedBeanModelAttributeToDataProviderAdapter.php.

isRelationTypeAHasManyVariant (  ) 
Returns:
bool

Definition at line 251 of file RedBeanModelAttributeToDataProviderAdapter.php.

isRelationTypeAHasOneVariant (  ) 
Returns:
bool

Definition at line 260 of file RedBeanModelAttributeToDataProviderAdapter.php.

hasRelatedAttribute (  ) 
Returns:
true/false if the $relatedAttribute was specified in the construcor.

Definition at line 269 of file RedBeanModelAttributeToDataProviderAdapter.php.

getRelationModel (  )  [protected]

If the attribute is a relation, returns the RedBeanModel of that relation.

Reimplemented in OwnedSecurableItemIdToDataProviderAdapter, and ReadOptimizationDerivedAttributeToDataProviderAdapter.

Definition at line 281 of file RedBeanModelAttributeToDataProviderAdapter.php.

getRelationModelClassName (  ) 

If the attribute is a relation, returns the model class name of that relation.

Reimplemented in OwnedSecurableItemIdToDataProviderAdapter, and ReadOptimizationDerivedAttributeToDataProviderAdapter.

Definition at line 294 of file RedBeanModelAttributeToDataProviderAdapter.php.

getRelatedAttributeModelClassName (  ) 

If the attribute is a relation, returns the model class name of that relation's relatedAttribute. This might be different than the relation's model class name if the relatedAttribute is casted up.

Reimplemented in OwnedSecurableItemIdToDataProviderAdapter, and ReadOptimizationDerivedAttributeToDataProviderAdapter.

Definition at line 304 of file RedBeanModelAttributeToDataProviderAdapter.php.

canRelationHaveTable (  ) 

If the relation model class can have a bean.

Definition at line 317 of file RedBeanModelAttributeToDataProviderAdapter.php.

getRelationTableName (  ) 

If the attribute is a relation, returns the relation's table name.

Reimplemented in OwnedSecurableItemIdToDataProviderAdapter, and ReadOptimizationDerivedAttributeToDataProviderAdapter.

Definition at line 326 of file RedBeanModelAttributeToDataProviderAdapter.php.

getRelationModelClassNameThatCanHaveATable (  ) 

If the attribute is a relation, returns the relation model class name or the next available that can have a table

Definition at line 351 of file RedBeanModelAttributeToDataProviderAdapter.php.

getRelatedAttributeTableName (  ) 

If the attribute is a relation, returns the relation's relatedAttribute's table name.

Reimplemented in OwnedSecurableItemIdToDataProviderAdapter, and ReadOptimizationDerivedAttributeToDataProviderAdapter.

Definition at line 375 of file RedBeanModelAttributeToDataProviderAdapter.php.

getRelatedAttributeColumnName (  ) 

If the attribute is a relation, returns the relation's relatedAttribute's column name.

Reimplemented in OwnedSecurableItemIdToDataProviderAdapter, and ReadOptimizationDerivedAttributeToDataProviderAdapter.

Definition at line 385 of file RedBeanModelAttributeToDataProviderAdapter.php.

getRelatedAttributeColumnNameByPosition ( attributePosition  ) 

If the attribute is a relation and the attribute has more sort attributes on the relation retunrs the column name to make the sort by the position in the array return from getSortAttributesByAttribute

Returns:
string

Definition at line 397 of file RedBeanModelAttributeToDataProviderAdapter.php.

isRelatedAttributeRelation (  ) 
Returns:
true/false - Is the attribute a relation on the model class name.

Definition at line 412 of file RedBeanModelAttributeToDataProviderAdapter.php.

getRelatedAttributeRelationType (  ) 
Returns:
The relation type of the attribute on the model class name.

Definition at line 421 of file RedBeanModelAttributeToDataProviderAdapter.php.

getRelatedAttributeRelationModelClassName (  ) 
Returns:
mixed
Exceptions:
NotSupportedException 

Definition at line 435 of file RedBeanModelAttributeToDataProviderAdapter.php.

getManyToManyTableName (  ) 
Returns:
string
Exceptions:
NotSupportedException 

Definition at line 449 of file RedBeanModelAttributeToDataProviderAdapter.php.

isAttributeMixedIn (  ) 
Returns:
bool

Definition at line 462 of file RedBeanModelAttributeToDataProviderAdapter.php.

isAttributeOnDifferentModel (  ) 
Returns:
bool

Definition at line 475 of file RedBeanModelAttributeToDataProviderAdapter.php.

resolveManyToManyColumnName (  ) 

Resolve which column to use when querying a many to many relation.

Returns:
string

Definition at line 488 of file RedBeanModelAttributeToDataProviderAdapter.php.

getOpposingRelationModelClassName (  ) 

In the case of account -> meeting, this method returns 'Activity' since 'Activity' is the model that the opposing relation rests on. This is different than getDerivedRelationModelClassName which would be 'Meeting'. Sometimes both are the same model, it just depends if the final model class is casted down or not

Returns:
mixed

Definition at line 544 of file RedBeanModelAttributeToDataProviderAdapter.php.

getDerivedRelationViaCastedUpModelClassName (  ) 
Returns:
mixed

Definition at line 556 of file RedBeanModelAttributeToDataProviderAdapter.php.

isInferredRelation (  ) 

Extend as needed to support inferred relations

See also:
InferredRedBeanModelAttributeToDataProviderAdapter
Returns:
bool

Reimplemented in InferredRedBeanModelAttributeToDataProviderAdapter.

Definition at line 584 of file RedBeanModelAttributeToDataProviderAdapter.php.

sortUsesTwoAttributes (  ) 

Returns true if the attribute uses another attribute in the sort

Returns:
boolean

Definition at line 593 of file RedBeanModelAttributeToDataProviderAdapter.php.


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