Item Class Reference

Inheritance diagram for Item:
CustomFieldsModel RedBeanModel BeanModel ObservableComponent AccountAccountAffiliation AccountContactAffiliation AuditTestItem Autoresponder ByTimeWorkflowInQueue Comment ContactWebFormEntry CurrencyValueTestItem EmailAccount EmailBox EmailFolder EmailMessageActivity FileModel GameBadge GameCoin GameCollection GameLevel GamePoint GameScore Import JobInProcess JobLog ModelWithAttachmentTestItem Notification NotificationMessage Permitable ProductCatalog ProductCategory ProductTemplate Role SavedWorkflow SecurableItem TestOwnedCustomFieldsModel TestOwnedLinkSpecificModel WorkflowMessageInQueue

Public Member Functions

 onCreated ()
 onModified ()
 __set ($attributeName, $value)
 delete ()
 save ($runValidation=true, array $attributeNames=null)
 addWorkflowToProcessAfterSave (Workflow $workflow)
 getWorkflowsToProcessAfterSave ()
 setDoNotProcessWorkflowOnSave ()
 setProcessWorkflowOnSave ()
 shouldProcessWorkflowOnSave ()
 forgetOriginalAttributeValues ()
 testBeforeDelete ()
 isAttributeAudited ($attributeName)
 isAllowedToSetReadOnlyAttribute ($attributeName)

Static Public Member Functions

static getDefaultMetadata ()
static isTypeDeletable ()
static getGamificationRulesType ()
static getNonConfigurableAttributes ()
static getByName ($name)

Data Fields

 $originalAttributeValues = array()

Protected Member Functions

 beforeSave ()
 afterSave ()
 logAuditEventsListForCreatedAndModifed ($newModel)

Static Protected Member Functions

static getByNameOrEquivalent ($attributeName, $value)
static translatedAttributeLabels ($language)

Protected Attributes

 $isSetting = false
 $isAudited = true

Detailed Description

Definition at line 37 of file Item.php.


Member Function Documentation

onCreated (  ) 

Called on construction when a new model is created.

Reimplemented from RedBeanModel.

Reimplemented in Activity, Conversation, Mission, and SocialItem.

Definition at line 59 of file Item.php.

onModified (  ) 

Called when a model is modified.

Reimplemented from RedBeanModel.

Definition at line 65 of file Item.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 EmailTemplate, GamePoint, Group, OwnedSecurableItem, and SecurableItem.

Definition at line 91 of file Item.php.

delete (  ) 

Deletes the model from the database.

Reimplemented from RedBeanModel.

Reimplemented in SecurableItem.

Definition at line 110 of file Item.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.

Reimplemented in User, and NamedSecurableItem.

Definition at line 121 of file Item.php.

static getByNameOrEquivalent ( attributeName,
value 
) [static, protected]
Parameters:
string $attributeName
string $value
Returns:
An

Definition at line 156 of file Item.php.

beforeSave (  )  [protected]

Special handling of the import scenario. When you are importing a model, you can potentially set the created/modified user/datetime which is normally not allowed since they are read-only attributes. This logic helps to allow for this special use case.

See also:
RedBeanModel::beforeSave()

Reimplemented from RedBeanModel.

Reimplemented in Conversation, EmailMessageActivity, Meeting, Mission, Note, Opportunity, SocialItem, Task, User, FileModel, Group, and Role.

Definition at line 169 of file Item.php.

static getDefaultMetadata (  )  [static]

Returns the default meta data for the class. It must be appended to the meta data from the parent model, if any.

Reimplemented from RedBeanModel.

Reimplemented in AccountAccountAffiliation, AccountContactAffiliation, Account, Activity, ApiTestModelItem, ApiTestModelItem2, ApiTestModelItem3, ApiTestModelItem4, Autoresponder, AutoresponderItemActivity, SavedCalendar, Campaign, CampaignItemActivity, Comment, Contact, ContactWebForm, ContactWebFormEntry, Conversation, EmailAccount, EmailBox, EmailFolder, EmailMessage, EmailMessageActivity, EmailTemplate, EmailTemplateModelTestItem, ExportItem, ExportTestModelItem, ExportTestModelItem2, ExportTestModelItem3, ExportTestModelItem4, ExportTestModelItem5, GameReward, GameBadge, GameCoin, GameCollection, GameLevel, GamePoint, GameScore, Dashboard, Import, ImportDedupeModelTestItem, ImportModelTestItem, ImportModelTestItem2, ImportModelTestItem3, ImportModelTestItem4, ImportModelTestItem5, JobInProcess, JobLog, MarketingList, Meeting, Mission, Note, Notification, NotificationMessage, Opportunity, Product, ProductCatalog, ProductCategory, ProductTemplate, Project, SavedReport, ReportModelTestItem, ReportModelTestItem10, ReportModelTestItem2, ReportModelTestItem3, ReportModelTestItem4, ReportModelTestItem5, ReportModelTestItem6, ReportModelTestItem7, ReportModelTestItem8, ReportModelTestItem9, SocialItem, Task, User, ByTimeWorkflowInQueue, SavedWorkflow, WorkflowMessageInQueue, ByTimeWorkflowInQueueForTest, WorkflowModelTestItem, WorkflowModelTestItem2, WorkflowModelTestItem3, WorkflowModelTestItem4, WorkflowModelTestItem5, WorkflowModelTestItem6, WorkflowModelTestItem7, WorkflowModelTestItem8, WorkflowModelTestItem9, FileModel, Group, NamedSecurableItem, OwnedSecurableItem, Permitable, Person, Role, SavedSearch, SecurableItem, AuditTestItem, CurrencyValueTestItem, ModelToArrayAdapterTestItem, ModelToArrayAdapterTestItem2, ModelToArrayAdapterTestItem3, ModelToArrayAdapterTestItem4, ModelWithAttachmentTestItem, OwnedSecurableTestItem, OwnedSecurableTestItem2, TestOwnedCustomFieldsModel, and TestOwnedLinkSpecificModel.

Definition at line 227 of file Item.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 AccountAccountAffiliation, AccountContactAffiliation, Account, Activity, ApiTestModelItem, ApiTestModelItem2, ApiTestModelItem3, ApiTestModelItem4, Autoresponder, SavedCalendar, Campaign, Comment, Contact, ContactWebForm, ContactWebFormEntry, Conversation, EmailAccount, EmailBox, EmailFolder, EmailMessage, EmailMessageActivity, EmailTemplate, EmailTemplateModelTestItem, ExportItem, ExportTestModelItem, ExportTestModelItem2, ExportTestModelItem3, ExportTestModelItem4, ExportTestModelItem5, GameReward, GameBadge, GameCoin, GameCollection, GameLevel, GamePoint, GameScore, Dashboard, Import, ImportDedupeModelTestItem, ImportModelTestItem, ImportModelTestItem2, ImportModelTestItem3, ImportModelTestItem4, ImportModelTestItem5, JobInProcess, JobLog, MarketingList, Meeting, Mission, Note, Notification, NotificationMessage, Opportunity, Product, ProductCatalog, ProductCategory, ProductTemplate, Project, SavedReport, ReportModelTestItem, ReportModelTestItem10, ReportModelTestItem2, ReportModelTestItem3, ReportModelTestItem4, ReportModelTestItem5, ReportModelTestItem6, ReportModelTestItem7, ReportModelTestItem8, ReportModelTestItem9, SocialItem, Task, User, ByTimeWorkflowInQueue, SavedWorkflow, WorkflowMessageInQueue, WorkflowModelTestItem, WorkflowModelTestItem2, WorkflowModelTestItem3, WorkflowModelTestItem4, WorkflowModelTestItem5, WorkflowModelTestItem6, WorkflowModelTestItem7, WorkflowModelTestItem8, WorkflowModelTestItem9, FileModel, Group, NamedSecurableItem, OwnedSecurableItem, Permitable, Person, Role, SavedSearch, SecurableItem, ModelToArrayAdapterTestItem, ModelToArrayAdapterTestItem2, ModelToArrayAdapterTestItem3, ModelToArrayAdapterTestItem4, ModelWithAttachmentTestItem, OwnedSecurableTestItem, and TestOwnedLinkSpecificModel.

Definition at line 259 of file Item.php.

testBeforeDelete (  ) 

Used for testing only. In scenarios where you need to test beforeDelete but can't because beforeDelete is protected

Definition at line 268 of file Item.php.

isAttributeAudited ( attributeName  ) 

See the yii documentation.

Definition at line 276 of file Item.php.

isAllowedToSetReadOnlyAttribute ( attributeName  ) 

Override to handle the import scenario. During import you are allowed to externally set several read-only attributes. (non-PHPdoc)

See also:
RedBeanModel::isAllowedToSetReadOnlyAttribute()

Reimplemented from RedBeanModel.

Reimplemented in AccountContactAffiliation, and User.

Definition at line 296 of file Item.php.

static getGamificationRulesType (  )  [static]
Returns:
string of gamificationRulesType Override for a child class as needed.

Reimplemented in Account, SavedCalendar, Campaign, Comment, Contact, Conversation, EmailTemplate, MarketingList, Meeting, Mission, Note, Opportunity, Product, ProductCatalog, ProductCategory, ProductTemplate, Project, SavedReport, SocialItem, Task, and SavedWorkflow.

Definition at line 319 of file Item.php.


The documentation for this class was generated from the following file:
 All Data Structures Functions Variables
Generated on Mon Oct 16 07:10:26 2017