All Data Structures Functions Variables Pages
Public Member Functions | Static Protected Member Functions | Protected Attributes
RedBeanMutableRelatedModels Class Reference
Inheritance diagram for RedBeanMutableRelatedModels:
RedBeanModels RedBeanManyToManyRelatedModels RedBeanOneToManyRelatedModels

Public Member Functions

 contains (RedBeanModel $model)
 
 add (RedBeanModel $model)
 
 remove (RedBeanModel $model)
 
 removeByIndex ($i)
 
 removeAll ()
 
 getErrors ($attributeNameOrNames=null)
 
 save ($runValidation=true)
 
 isModified ()
 
- 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 ()
 

Static Protected Member Functions

static array_remove_object (&$array, $object)
 

Protected Attributes

 $modified = false
 
 $deferredRelateBeans = array()
 
 $deferredUnrelateBeans = array()
 
- Protected Attributes inherited from RedBeanModels
 $modelClassName
 
 $bean
 
 $relatedBeansAndModels = array()
 

Additional Inherited Members

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

Detailed Description

Contains all of the models of a particular type associated with a model in a one to many relationship. Once added this controls the lifetime of the models.

Definition at line 45 of file RedBeanMutableRelatedModels.php.

Member Function Documentation

add ( RedBeanModel  $model)

Adds a related model.

Definition at line 73 of file RedBeanMutableRelatedModels.php.

remove ( RedBeanModel  $model)

Unrelates a model.

Definition at line 93 of file RedBeanMutableRelatedModels.php.

removeByIndex (   $i)

Unrelates a model by index.

Definition at line 112 of file RedBeanMutableRelatedModels.php.

removeAll ( )

Unrelates all of the related models.

Definition at line 153 of file RedBeanMutableRelatedModels.php.

getErrors (   $attributeNameOrNames = null)

Returns the errors for the related models.

Parameters
$attributeNameOrNamesSee RedNeamModel::getErrors().

Definition at line 168 of file RedBeanMutableRelatedModels.php.

isModified ( )

Returns true if any of the models have been added to or removed from the collection or of any models in the collection have been modified.

Definition at line 197 of file RedBeanMutableRelatedModels.php.

Field Documentation

$deferredRelateBeans = array()
protected

Contains beans that need relating on save. They are not related on add so that if save is never called nothing is left in the database.

Definition at line 54 of file RedBeanMutableRelatedModels.php.

$deferredUnrelateBeans = array()
protected

Contains beans that need unrelating on save. They are not unrelated on remove so that if save is never called the relation is still in the database.

Definition at line 61 of file RedBeanMutableRelatedModels.php.


The documentation for this class was generated from the following file:
Generated on Mon Jan 27 2020 07:10:47