RedBeanOneToManyRelatedModels Class Reference

Inheritance diagram for RedBeanOneToManyRelatedModels:
RedBeanMutableRelatedModels RedBeanModels

Public Member Functions

 __construct (RedBeanModel $relatedModel, RedBean_OODBBean $bean, $modelClassName, $relatedModelClassName, $relatedAttributeName, $owns, $linkType, $linkName=null)
 getModelClassName ()
 save ($runValidation=true)
 getStringifiedData ()
 add (RedBeanModel $model)
 removeByIndex ($i)

Protected Member Functions

 resolveLinkNameForCasing ()
 getOpposingRelationName ($model)

Protected Attributes

 $relatedModel
 $relatedModelClassName
 $relatedAttributeName
 $deferredUnrelatedModels = array()
 $owns
 $linkType
 $linkName
 $opposingRelationName
 $opposingRelationNameRetrieved = false

Detailed Description

Relates models as RedBean links, so that the relationship is 1:M via a foreign key.

Definition at line 44 of file RedBeanOneToManyRelatedModels.php.


Constructor & Destructor Documentation

__construct ( RedBeanModel relatedModel,
RedBean_OODBBean $  bean,
modelClassName,
relatedModelClassName,
relatedAttributeName,
owns,
linkType,
linkName = null 
)

Constructs a new RedBeanOneToManyRelatedModels. The models are retrieved lazily. RedBeanOneToManyRelatedModels are only constructed with beans by the model. Beans are never used by the application directly.

Definition at line 99 of file RedBeanOneToManyRelatedModels.php.


Member Function Documentation

save ( runValidation = true  ) 

Saves all of the models in the collection that have been lazily retrieved.

Reimplemented from RedBeanMutableRelatedModels.

Definition at line 187 of file RedBeanOneToManyRelatedModels.php.

getStringifiedData (  ) 

Return an array of stringified values for each of the contained models.

Definition at line 252 of file RedBeanOneToManyRelatedModels.php.

add ( RedBeanModel model  ) 

Adds a related model. Override to support finding opposing relation and making adjustment so when accessing the opposing model, it will reflect properly the changes to the relation. Ignoring when the relations are for the same model, because there is currently an issue with this being supported with group/groups. Eventually todo: fix that and we can open it up to relations with the same model.

Reimplemented from RedBeanMutableRelatedModels.

Definition at line 271 of file RedBeanOneToManyRelatedModels.php.

removeByIndex ( i  ) 

Unrelates a model by index. Override to support finding opposing relation and making adjustment so when accessing the opposing model, it will reflect properly the changes to the relation. Ignoring when the relations are for the same model, because there is currently an issue with this being supported with group/groups. Eventually todo: fix that and we can open it up to relations with the same model.

Reimplemented from RedBeanMutableRelatedModels.

Definition at line 287 of file RedBeanOneToManyRelatedModels.php.


The documentation for this class was generated from the following file:
 All Data Structures Functions Variables
Generated on Fri Jun 23 07:10:28 2017