All Data Structures Functions Variables Pages
Public Member Functions | Protected Member Functions | Protected Attributes
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)
 
- Public Member Functions inherited from RedBeanModels
 __toString ()
 
 offsetSet ($i, $value)
 
 offsetExists ($i)
 
 offsetUnset ($i)
 
 offsetGet ($i)
 
 rewind ()
 
 current ()
 
 key ()
 
 next ()
 
 valid ()
 
 count ()
 
 contains (RedBeanModel $model)
 
 hasErrors ($attributeNameOrNames)
 
 validate (array $attributeNames=null)
 
 save ($runValidation=true)
 
 isModified ()
 

Protected Member Functions

 resolveLinkNameForCasing ()
 
 getOpposingRelationName ($model)
 
- Protected Member Functions inherited from RedBeanModels
 getByIndex ($i)
 

Protected Attributes

 $relatedModel
 
 $relatedModelClassName
 
 $relatedAttributeName
 
 $deferredUnrelatedModels = array()
 
 $owns
 
 $linkType
 
 $linkName
 
 $opposingRelationName
 
 $opposingRelationNameRetrieved = false
 
- Protected Attributes inherited from RedBeanModels
 $modelClassName
 
 $bean
 
 $relatedBeansAndModels = array()
 

Additional Inherited Members

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

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.

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.

Definition at line 287 of file RedBeanOneToManyRelatedModels.php.


The documentation for this class was generated from the following file:
Generated on Mon Apr 6 2020 07:11:18