OwnedModel Class Reference

Inheritance diagram for OwnedModel:
RedBeanModel BeanModel ObservableComponent Address AutoresponderItem CampaignItem ConversationParticipant CurrencyValue Email EmailMessageContent EmailMessageRecipient EmailMessageSender EmailMessageSendError EmailMessageUrl EmailSignature ExtendsOwnedModel GamePointTransaction GameRewardTransaction MarketingListMember NotificationSubscriber Permission PersonWhoHaveNotReadLatest Policy ReportModelTestItem11 Right SellPriceFormula TaskCheckListItem

Public Member Functions

 __set ($attributeName, $value)
 save ($runValidation=true, array $attributeNames=null)
 unrestrictedSave ($runValidation=true, array $attributeNames=null)
 forgetOriginalAttributeValues ()

Static Public Member Functions

static getCanHaveBean ()
static isTypeDeletable ()

Data Fields

 $originalAttributeValues = array()

Static Protected Attributes

static $lastClassInBeanHeirarchy = 'OwnedModel'

Detailed Description

A model owned by a SecurableItem in the sense that it is included in a relation with RedBeanModel::OWNED - its lifetime is controlled by the owning model. SecurableItems are secured and auditable and so the related models that they own are secured and auditable.

Definition at line 44 of file OwnedModel.php.


Member Function Documentation

static getCanHaveBean (  )  [static]
See also:
RedBeanModel::getHasBean()

Reimplemented from BeanModel.

Definition at line 64 of file OwnedModel.php.

__set ( attributeName,
value 
)

Sets the members and relations of the model as if they were actual attributes of the model. For example, if Account extends RedBeanModel and its attributeNames() returns that one it has a member 'name' and a relation 'owner' they are simply accessed as:

   $account = new Account();
   $account->name = 'International Corp';
   $account->owner = User::getByUsername('bill');
   $account->save();
Parameters:
$attributeName A non-empty string that is the name of a member or relation of the model.
$value A value or model of the type specified as valid for the member or relation by the meta data supplied by the extending class's getMetadata() method.

Reimplemented from RedBeanModel.

Reimplemented in Permission.

Definition at line 73 of file OwnedModel.php.

save ( runValidation = true,
array $  attributeNames = null 
)

Saves the model to the database. Models are only saved if they have been modified and related models are saved before this model. If a related model is modified and needs saving the deems the model to be modified and need saving, which ensures that keys are updated. Cyclic relationships are prevented from causing problems by the save only proceeding to non-saved models.

Reimplemented from RedBeanModel.

Definition at line 79 of file OwnedModel.php.

static isTypeDeletable (  )  [static]

To be overriden on intermediate derived classes to return false so that deletes are not done on intermediate classes because the object relational mapping will not clean up properly. For example if User is a Person, and Person is a RedBeanModel delete should be called only on User, not on Person. So User must override isDeletable to return false.

Reimplemented from RedBeanModel.

Reimplemented in AutoresponderItem, CampaignItem, ConversationParticipant, EmailMessageContent, EmailMessageRecipient, EmailMessageSender, EmailMessageSendError, EmailMessageUrl, EmailSignature, MarketingListMember, PersonWhoHaveNotReadLatest, SellPriceFormula, ReportModelTestItem11, Address, CurrencyValue, Email, Permission, Policy, and Right.

Definition at line 95 of file OwnedModel.php.


Field Documentation

$lastClassInBeanHeirarchy = 'OwnedModel' [static, protected]
See also:
RedBeanModel::$lastClassInBeanHeirarchy

Reimplemented from RedBeanModel.

Definition at line 51 of file OwnedModel.php.


The documentation for this class was generated from the following file:
 All Data Structures Functions Variables
Generated on Tue Sep 30 07:10:28 2014