RedBeanModel Class Reference

Inheritance diagram for RedBeanModel:
BeanModel ObservableComponent A ActiveLanguage AuditEvent BaseCustomField BaseStarredModel ContactState Currency CustomFieldData CustomFieldsModel CustomFieldValue DateDateTime DDD DerivedAttributeMetadata E F FFF FileContent G GameNotification GGG GlobalMetadata H HHH III KanbanItem M MashableInboxForTestModel MessageSource MessageTranslation MixedRelationsModel NoBean OwnedModel P PerUserMetadata Portlet PP PPP PPPP ProjectAuditEvent QueryFromModel SavedCalendarSubscription ShortUrl StuckJob TestAttributeNamedLikeSqlKeywordModel TestBlobModel TestBooleanAttributeModel TestDatabaseBulkInsertModel TestDataUtilModel TestDateTimeModel TestDateTimeUserModel TestDefaultedAttributeModel TestGetAttributeLabelModel TestIdentityModel TestInvalidSpecificLinkType TestManyManyRelationToItemModel TestModelJoinHasManyAndHasOneBelongsToSide TestModelJoinHasManySide TestModelJoinHasOneSide TestModelJoinManyManySide TestModelJoinManyManySideTwo TestModelToMessagesModel TestNameModel TestOperatorTypeModel TestPolyOneToManyOneSide TestPolyOneToManyOneSideTwo TestPolyOneToManyPolySide TestPolyOneToManyPolySideOwned TestPrecisionModel TestReadOnlyAttributeModel TestSelfRelatingModel TestSimplestManyRelationModel TestSimplestModel TestTypesModel TestViewMetadataValidatorModel ThingWithCalculatedDates X Z ZZ

Public Member Functions

 getIsNewModel ()
 __construct ($setDefaults=true, RedBean_OODBBean $bean=null, $forceTreatAsCreation=false, $runConstruction=true)
 serialize ()
 unserialize ($data)
 getPrimaryBean ()
 getClassId ($modelClassName)
 getClassBean ($modelClassName)
 getModelIdentifier ()
 castDown (array $derivedModelClassNames)
 isSame (RedBeanModel $model)
 __toString ()
 __get ($attributeName)
 __set ($attributeName, $value)
 __isset ($attributeName)
 __unset ($attributeName)
 attributeNames ()
 isAttribute ($attributeName)
 isAttributeWithLowerCaseConversion ($attributeName)
 isAttributeReadOnly ($attributeName)
 isAttributeFormattedAsProbability ($attributeName)
 isAllowedToSetReadOnlyAttribute ($attributeName)
 rules ()
 behaviors ()
 attributeLabels ()
 abbreviatedAttributeLabels ()
 validate (array $attributeNames=null, $ignoreRequiredValidator=false)
 onBeforeValidate (CModelEvent $event)
 onAfterValidate ($event)
 getValidatorList ()
 getValidators ($attributeName=null)
 forgetValidators ()
 createValidators ()
 isUniqueAttributeValue ($attributeName, $value)
 save ($runValidation=true, array $attributeNames=null)
 isRelatedModelReallyModified ($relatedModel, $relationType, $isOwned)
 isReallyModified ($relationType, $isOwned)
 onBeforeSave ($event)
 onAfterSave ($event)
 onRedBeanOneToManyRelatedModelsChange ($event)
 onBeforeDelete ($event)
 onAfterDelete ($event)
 isModified ()
 delete ()
 isDeleted ()
 isDeletable ()
 forget ()
 isAttributeRequired ($attributeName)
 isAttributeSafe ($attributeName)
 getAttributeLabel ($attributeName)
 getAttributeLabelsForAllActiveLanguagesByAttributeName ($attributeName)
 hasErrors ($attributeNameOrNames=null)
 getErrors ($attributeNameOrNames=null)
 getError ($attributeName)
 addError ($attributeName, $errorMessage)
 addErrors (array $errors)
 clearErrors ($attributeName=null)
 generateAttributeLabel ($attributeName)
 getAttributes (array $attributeNames=null)
 setAttributes (array $values, $safeOnly=true)
 unsetAttributes ($attributeNames=null)
 onUnsafeAttribute ($name, $value)
 getScenario ()
 setScenario ($scenarioName)
 getSafeAttributeNames ()
 getIterator ()
 offsetExists ($offset)
 offsetGet ($offset)
 offsetSet ($offset, $item)
 offsetUnset ($offset)
 stringifyOneToManyRelatedModelsValues ($values)
 setIsCopied ()
 isCopied ()
 addValidator ($attribute, $validator, $params=array())

Static Public Member Functions

static model ($className=null)
static getAll ($orderBy=null, $sortDescending=false, $modelClassName=null)
static getSubset (RedBeanModelJoinTablesQueryAdapter $joinTablesAdapter=null, $offset=null, $count=null, $where=null, $orderBy=null, $modelClassName=null, $selectDistinct=false)
static getSubsetIds (RedBeanModelJoinTablesQueryAdapter $joinTablesAdapter=null, $offset=null, $count=null, $where=null, $orderBy=null, $modelClassName=null, $selectDistinct=false)
static makeSubsetOrCountSqlQuery ($tableName, RedBeanModelJoinTablesQueryAdapter $joinTablesAdapter, $offset=null, $count=null, $where=null, $orderBy=null, $selectCount=false, $selectDistinct=false, array $quotedExtraSelectColumnNameAndAliases=array())
static getCount (RedBeanModelJoinTablesQueryAdapter $joinTablesAdapter=null, $where=null, $modelClassName=null, $selectDistinct=false)
static getById ($id, $modelClassName=null)
static deleteAll ()
static mangleTableName ()
static getTableName ()
static getTableNames ($classNames)
static getForeignKeyName ($modelClassName, $relationName)
static getModelClassNameByIdentifier ($identifier)
static getMetadata ()
static canSaveMetadata ()
static setMetadata (array $metadata)
static getDefaultMetadata ()
static isTypeDeletable ()
static forgetAll ()
static getModelLabelByTypeAndLanguage ($type, $language=null)
static getAnAttributeLabel ($attributeName)
static makeModel (RedBean_OODBBean $bean, $modelClassName=null)
static makeModels (array $beans, $modelClassName=null)
static getModuleClassName ()
static getLastClassInBeanHeirarchy ()
static getSortAttributesByAttribute ($attribute)
static isCacheable ()
static getYiiValidatorsToRedBeanValidators ()
static getHasManyOpposingRelationName (RedBeanModel $model, $precedingModelClassName, $precedingRelation)
static relationLinksToPrecedingRelation ($modelClassName, $relation, $precedingModelClassName=null, $precedingRelation=null)
static allowMemcacheCache ()

Data Fields

const MODEL_IDENTIFIER_DELIMITER = '_'

Protected Member Functions

 constructDerived ($bean, $setDefaults)
 constructIncomplete ($bean)
 setNotModified ()
 onCreated ()
 onLoaded ()
 onModified ()
 mapAndCacheMetadataAndSetHints ($modelClassName, RedBean_OODBBean $bean)
 runDefaultValidators ()
 setClassBean ($modelClassName, RedBean_OODBBean $bean)
 unrestrictedGet ($attributeName)
 unrestrictedSet ($attributeName, $value)
 beforeValidate ()
 afterValidate ()
 beforeSave ()
 afterSave ()
 linkBeans ()
 beforeDelete ()
 afterDelete ()
 unrestrictedDelete ()
 deleteOwnedRelatedModels ($modelClassName)
 deleteForeignRelatedModels ($modelClassName)
 deleteManyManyRelations ($modelClassName)

Static Protected Member Functions

static makeCasedLinkName ($relationType, $linkType, $relationLinkName)
static getModelIdentifierByClassNameAndBeanId ($modelClassName, $beanId)
static assertMetadataIsValid (array $metadata)
static getByRelatedClassId ($relatedModelClassName, $id, $modelClassName=null)
static getLabel ($language=null)
static getPluralLabel ($language=null)
static getAttributeLabelByLanguage ($attributeName, $language)
static getTranslatedCustomAttributeLabelByLanguage ($attributeName, $languageCode)
static resolveModelClassNameForClassesWithoutBeans (&$modelClassName)

Protected Attributes

 $modelClassNameToBean = array()
 $attributeNameToBeanAndClassName = array()
 $relationNameToRelatedModel = array()
 $unlinkedRelationNames = array()
 $unlinkedOwnedRelatedModelsToRemove = array()
 $validators = array()
 $attributeNameToErrors = array()
 $scenarioName = ''
 $modified = false
 $deleted = false
 $isInIsModified = false
 $isInHasErrors = false
 $isInGetErrors = false
 $isValidating = false
 $isSaving = false
 $isDeleting = false
 $isNewModel = false
 $isCopied = false
 $isSavableFromRelation = true

Static Protected Attributes

static $lastClassInBeanHeirarchy = 'RedBeanModel'
static $attributeLabelsByLanguage = array()

Detailed Description

Abstraction over the top of an application database accessed via RedBean. The base class for an MVC model. Replaces the M part of MVC in Yii. Yii maps from the database scheme to the objects, (good for database guys, not so good for OO guys), this maps from objects to the database schema.

A domain model is created by extending RedBeanModel and supplying a getDefaultMetadata() method.

Static getXxxx() methods can be supplied to query for the given domain models, and instance methods should supply additional behaviour.

getDefaultMetadata() returns an array of the class name mapped to an array containing 'members' mapped to an array of member names, (to be accessed as $model->memberName).

It can then optionally have, 'relations' mapped to an array of relation names, (to be accessed as $model->relationName), mapped to its type, (the extending model class to which it relates).

And it can then optionally have as well, 'rules' mapped to an array of attribute names, (attributes are members and relations), a validator name, and the parameters to the validator, if any, as per the Yii::CModel::rules() method.See http://www.yiiframework.com/wiki/56/reference-model-rules-validation.

These are used to automatically and dynamically create the database schema on the fly as opposed to Yii's getting attributes from an already existing schema.

Definition at line 67 of file RedBeanModel.php.


Constructor & Destructor Documentation

__construct ( setDefaults = true,
RedBean_OODBBean $  bean = null,
forceTreatAsCreation = false,
runConstruction = true 
)

Constructs a new model. Important: Models are only constructed with beans by the RedBeanModel. Beans are never used by the application directly. The application can construct a new model object by constructing a model without specifying a bean. In other words, if Php had overloading a constructor with $setDefaults would be public, and a constructor taking a $bean and $forceTreatAsCreation would be private.

Parameters:
$setDefaults. If false the default validators will not be run on construction. The Yii way is that defaults are filled in after the fact, which is counter the usual for objects.
$bean A bean. Never specified by an application.
$forceTreatAsCreation. Never specified by an application.
$runConstruction. Sometimes a model is needed to hook in events and the construction logic does not necessarily need to be run.
See also:
getById()
makeModel()
makeModels()

Definition at line 416 of file RedBeanModel.php.


Member Function Documentation

static model ( className = null  )  [static]

Returns the static model of the specified AR class. The model returned is a static instance of the AR class. It is provided for invoking class-level methods (something similar to static class methods.)

EVERY derived AR class must override this method as follows,

 public static function model($className=__CLASS__)
 {
     return parent::model($className);
 }
 

This method will make a model that does not run construction

Parameters:
string $className active record class name.
Returns:
CActiveRecord active record model instance.

Definition at line 181 of file RedBeanModel.php.

static getAll ( orderBy = null,
sortDescending = false,
modelClassName = null 
) [static]

Gets all the models from the database of the named model type.

Parameters:
$orderBy TODO
$modelClassName Pass only when getting it at runtime gets the wrong name.
Returns:
An array of models of the type of the extending model.

Definition at line 205 of file RedBeanModel.php.

static getSubset ( RedBeanModelJoinTablesQueryAdapter joinTablesAdapter = null,
offset = null,
count = null,
where = null,
orderBy = null,
modelClassName = null,
selectDistinct = false 
) [static]

Gets a range of models from the database of the named model type.

Parameters:
$modelClassName 
$joinTablesAdapter null or instance of joinTablesAdapter.
$offset The zero based index of the first model to be returned.
$count The number of models to be returned.
$where 
$orderBy - sql string. Example 'a desc' or 'a.b desc'. Currently only supports non-related attributes
$modelClassName Pass only when getting it at runtime gets the wrong name.
Returns:
An array of models of the type of the extending model.

Definition at line 234 of file RedBeanModel.php.

static getSubsetIds ( RedBeanModelJoinTablesQueryAdapter joinTablesAdapter = null,
offset = null,
count = null,
where = null,
orderBy = null,
modelClassName = null,
selectDistinct = false 
) [static]

Gets a range of model ids from the database of the named model type.

Parameters:
$modelClassName 
$joinTablesAdapter null or instance of joinTablesAdapter.
$offset The zero based index of the first model to be returned.
$count The number of models to be returned.
$where 
$orderBy - sql string. Example 'a desc' or 'a.b desc'. Currently only supports non-related attributes
$modelClassName Pass only when getting it at runtime gets the wrong name.
Returns:
An array of models ids

Definition at line 268 of file RedBeanModel.php.

static makeSubsetOrCountSqlQuery ( tableName,
RedBeanModelJoinTablesQueryAdapter joinTablesAdapter,
offset = null,
count = null,
where = null,
orderBy = null,
selectCount = false,
selectDistinct = false,
array $  quotedExtraSelectColumnNameAndAliases = array() 
) [static]
Parameters:
boolean $selectCount If true then make this a count query. If false, select ids from rows.
array $quotedExtraSelectColumnNameAndAliases - extra columns to select.
Returns:
string - sql statement.

Reimplemented in OwnedSecurableItem.

Definition at line 300 of file RedBeanModel.php.

static getCount ( RedBeanModelJoinTablesQueryAdapter joinTablesAdapter = null,
where = null,
modelClassName = null,
selectDistinct = false 
) [static]
Parameters:
$modelClassName 
$joinTablesAdapter null or instance of joinTablesAdapter.
$modelClassName Pass only when getting it at runtime gets the wrong name.

Definition at line 337 of file RedBeanModel.php.

static getById ( id,
modelClassName = null 
) [static]

Gets a model from the database by Id.

Parameters:
$id Integer Id.
$modelClassName Pass only when getting it at runtime gets the wrong name.
Returns:
A model of the type of the extending model.

Reimplemented in Currency, and Group.

Definition at line 368 of file RedBeanModel.php.

static deleteAll (  )  [static]

Delete all models

Reimplemented in E, and Permission.

Definition at line 497 of file RedBeanModel.php.

constructIncomplete ( bean  )  [protected]

Utilized when pieces of information need to be constructed on an existing model, that can potentially be missing. For example, if a model is created, then a custom field is added, it is possible the cached model is missing the custom field customFieldData.

Parameters:
unknown_type $bean

Definition at line 529 of file RedBeanModel.php.

setNotModified (  )  [protected]

Overriding constructors must call this function to ensure that they leave the newly constructed instance not modified since anything modifying the class during constructionm will set it modified automatically.

Definition at line 586 of file RedBeanModel.php.

static mangleTableName (  )  [static]

By default the table name is the lowercased class name. If this conflicts with a database keyword override to return true. RedBean does not quote table names in most cases.

Reimplemented in User, Group, and Right.

Definition at line 598 of file RedBeanModel.php.

static getTableName (  )  [static]

Returns the table name for a class. For use by RedBeanModelDataProvider. It will not be of any use to an application. Applications should not be doing anything table related. Derived classes can refer directly to the table name.

Definition at line 611 of file RedBeanModel.php.

static getTableNames ( classNames  )  [static]

Returns the table names for an array of classes. For use by RedBeanModelDataProvider. It will not be of any use to an application.

Definition at line 629 of file RedBeanModel.php.

static getForeignKeyName ( modelClassName,
relationName 
) [static]

Used by classes such as containers which use sql to optimize getting models from the database.

Definition at line 643 of file RedBeanModel.php.

onCreated (  )  [protected]

Called on construction when a new model is created.

Reimplemented in Activity, Conversation, EmailMessageSendError, GameRewardTransaction, GamePointTransaction, MarketingListMember, Mission, Opportunity, SocialItem, Item, ShortUrl, and ShortUrlForTest.

Definition at line 683 of file RedBeanModel.php.

onLoaded (  )  [protected]

Called on construction when a model is loaded.

Definition at line 695 of file RedBeanModel.php.

onModified (  )  [protected]

Called when a model is modified.

Reimplemented in Opportunity, and Item.

Definition at line 707 of file RedBeanModel.php.

mapAndCacheMetadataAndSetHints ( modelClassName,
RedBean_OODBBean $  bean 
) [protected]

Used for mixins.

$this->relationNameToRelationTypeModelClassNameAndOwns[$relationName] = array($relationType, $relationModelClassName, $owns, $linkType, $relationLinkName);

Definition at line 726 of file RedBeanModel.php.

runDefaultValidators (  )  [protected]

Used for mixins.

Definition at line 922 of file RedBeanModel.php.

getPrimaryBean (  ) 

For use only by RedBeanModel and RedBeanModels. Beans are never used by the application directly.

Definition at line 937 of file RedBeanModel.php.

getClassId ( modelClassName  ) 

Used for optimization.

Definition at line 945 of file RedBeanModel.php.

setClassBean ( modelClassName,
RedBean_OODBBean $  bean 
) [protected]

Used for mixins.

Definition at line 963 of file RedBeanModel.php.

static getMetadata (  )  [static]

Returns metadata for the model. Attempts to cache metadata, if it is not already cached.

See also:
getDefaultMetadata()
Returns:
An array of metadata.

Reimplemented from BeanModel.

Reimplemented in User.

Definition at line 996 of file RedBeanModel.php.

static canSaveMetadata (  )  [static]

By default models cannot save their metadata, allowing them to be loaded quickly because the loading of of metadata can be avoided as much as possible. To make a model able to save its metadata override this method to return true. PUT it before the getDefaultMetadata in the derived class.

Reimplemented in KanbanItem, A, AAA, ExtendsNoBean, M, MixedRelationsModel, NoBean, P, PP, PPP, PPPP, TestModelJoinHasManyAndHasOneBelongsToSide, TestModelJoinHasManySide, TestModelJoinHasOneSide, TestModelJoinManyManySide, TestModelJoinManyManySideTwo, TestModelToMessagesModel, TestOperatorTypeModel, TestPolyOneToManyOneSide, TestPolyOneToManyOneSideTwo, TestPolyOneToManyPolySide, TestPolyOneToManyPolySideOwned, X, AccountAccountAffiliation, AccountContactAffiliation, Account, Activity, Autoresponder, AutoresponderEmailMessageContent, AutoresponderItem, SavedCalendar, Campaign, CampaignEmailMessageContent, CampaignItem, Comment, Contact, ContactWebForm, ContactWebFormEntry, Conversation, ConversationParticipant, EmailBox, EmailFolder, EmailMessage, EmailMessageActivity, EmailMessageContactVariableContent, EmailMessageRecipient, EmailMessageSender, EmailMessageSendError, EmailMessageUrl, EmailTemplate, EmailTemplateModelTestItem, GameReward, GameRewardTransaction, GameBadge, GameCoin, GameCollection, GameLevel, GameNotification, GamePoint, GamePointTransaction, GameScore, Import, MarketingList, MarketingListMember, PersonWhoHaveNotReadLatest, Meeting, Mission, Note, Opportunity, Product, ProductCatalog, ProductCategory, ProductTemplate, SellPriceFormula, Project, SavedReport, ReportModelTestItem11, ExternalApiEmailMessageActivity, SocialItem, Task, TaskCheckListItem, User, ByTimeWorkflowInQueue, SavedWorkflow, WorkflowMessageInQueue, Address, Currency, and ExtendsOwnedModel.

Definition at line 1053 of file RedBeanModel.php.

static setMetadata ( array $  metadata  )  [static]

Sets metadata for the model.

See also:
getDefaultMetadata()
Returns:
An array of metadata.

Reimplemented in User.

Definition at line 1063 of file RedBeanModel.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 in KanbanItem, ActiveLanguage, BaseCustomField, CalculatedDerivedAttributeMetadata, CustomField, CustomFieldData, CustomFieldValue, DerivedAttributeMetadata, DropDownDependencyDerivedAttributeMetadata, FileContent, GlobalMetadata, MessageSource, MessageTranslation, MultipleValuesCustomField, PerUserMetadata, Portlet, A, AAA, B, BBB, C, CCC, D, DateDateTime, DDD, E, EEE, ExtendsNoBean, F, FFF, G, GG, GGG, H, HHH, I, II, III, J, K, L, M, MixedRelationsModel, NoBean, P, PP, PPP, PPPP, QQ, QueryFromModel, TestAttributeNamedLikeSqlKeywordModel, TestBlobModel, TestBooleanAttributeModel, TestCustomFieldsModel, TestDatabaseBulkInsertModel, TestDataUtilModel, TestDateTimeModel, TestDateTimeUserModel, TestDefaultedAttributeModel, TestGetAttributeLabelModel, TestIdentityModel, TestInvalidSpecificLinkType, TestModelJoinHasManyAndHasOneBelongsToSide, TestModelJoinHasManySide, TestModelJoinHasOneSide, TestModelJoinManyManySide, TestModelJoinManyManySideTwo, TestModelToMessagesModel, TestNameModel, TestOperatorTypeModel, TestPolyOneToManyOneSide, TestPolyOneToManyOneSideTwo, TestPolyOneToManyPolySide, TestPolyOneToManyPolySideOwned, TestPrecisionModel, TestReadOnlyAttributeModel, TestSelfRelatingModel, TestSimplestManyRelationModel, TestSimplestModel, TestTypesModel, TestViewMetadataValidatorModel, X, Y, Z, ZZ, ThingWithCalculatedDates, AccountAccountAffiliation, AccountContactAffiliation, Account, AccountStarred, Activity, ApiTestModelItem, ApiTestModelItem2, ApiTestModelItem3, ApiTestModelItem4, Autoresponder, AutoresponderEmailMessageContent, AutoresponderItem, AutoresponderItemActivity, SavedCalendar, SavedCalendarSubscription, Campaign, CampaignEmailMessageContent, CampaignItem, CampaignItemActivity, Comment, Contact, ContactStarred, ContactState, ContactWebForm, ContactWebFormEntry, Conversation, ConversationParticipant, ConversationStarred, TestDropDownDependencyModel, EmailAccount, EmailBox, EmailFolder, EmailMessage, EmailMessageActivity, EmailMessageContactVariableContent, EmailMessageContent, EmailMessageRecipient, EmailMessageSender, EmailMessageSendError, EmailMessageUrl, EmailSignature, EmailTemplate, EmailTemplateModelTestItem, EmailTemplateModelTestItem2, ExportItem, ExportTestModelItem, ExportTestModelItem2, ExportTestModelItem3, ExportTestModelItem4, ExportTestModelItem5, ExportTestModelItem6, GameReward, GameRewardTransaction, GameBadge, GameCoin, GameCollection, GameLevel, GameNotification, GamePoint, GamePointTransaction, GameScore, Dashboard, Import, ImportDedupeModelTestItem, ImportModelTestItem, ImportModelTestItem2, ImportModelTestItem3, ImportModelTestItem4, ImportModelTestItem5, JobInProcess, JobLog, StuckJob, MarketingList, MarketingListMember, PersonWhoHaveNotReadLatest, Meeting, Mission, Note, Notification, NotificationMessage, NotificationSubscriber, Opportunity, OpportunityStarred, Product, ProductCatalog, ProductCategory, ProductTemplate, SellPriceFormula, Project, ProjectAuditEvent, ProjectStarred, SavedReport, SavedReportStarred, ReportModelTestItem, ReportModelTestItem10, ReportModelTestItem11, ReportModelTestItem12, ReportModelTestItem2, ReportModelTestItem3, ReportModelTestItem4, ReportModelTestItem5, ReportModelTestItem6, ReportModelTestItem7, ReportModelTestItem8, ReportModelTestItem9, ExternalApiEmailMessageActivity, SendGridEmailAccount, SocialItem, Task, TaskCheckListItem, TestManyManyRelationToItemModel, User, ByTimeWorkflowInQueue, SavedWorkflow, WorkflowMessageInQueue, ByTimeWorkflowInQueueForTest, WorkflowModelTestItem, WorkflowModelTestItem2, WorkflowModelTestItem3, WorkflowModelTestItem4, WorkflowModelTestItem5, WorkflowModelTestItem6, WorkflowModelTestItem7, WorkflowModelTestItem8, WorkflowModelTestItem9, Address, AuditEvent, BaseStarredModel, Currency, CurrencyValue, Email, FileModel, Group, ImageFileModel, Item, NamedSecurableItem, OwnedSecurableItem, Permission, Permitable, Person, Policy, Right, Role, SavedSearch, SecurableItem, ShortUrl, AuditTestItem, CurrencyValueTestItem, ExtendsOwnedModel, ModelToArrayAdapterTestItem, ModelToArrayAdapterTestItem2, ModelToArrayAdapterTestItem3, ModelToArrayAdapterTestItem4, ModelWithAttachmentTestItem, OwnedSecurableTestItem, OwnedSecurableTestItem2, OwnedSecurableTestItem3, TestOwnedCustomFieldsModel, and TestOwnedLinkSpecificModel.

Definition at line 1107 of file RedBeanModel.php.

castDown ( array $  derivedModelClassNames  ) 

Downcasting in general is a bad concept, but when pulling a Person from the database it would require a lot of jumping through hoops to make the RedBeanModel automatically figure out if that person is really a User, Contact, Customer or whatever might be derived from Person. So to avoid that complication and performance hit where it is not necessary this method can be used to convert a model to one of a given set of derivatives. If model is not one of those NotFoundException is thrown.

Definition at line 1170 of file RedBeanModel.php.

isSame ( RedBeanModel model  ) 

Returns whether the given object is of the same type with the same id.

Definition at line 1236 of file RedBeanModel.php.

__toString (  ) 

Returns the displayable string for the class. Should be overridden in any model that can provide a meaningful string representation of itself.

Returns:
A string.

Reimplemented in KanbanItem, CustomField, CustomFieldData, CustomFieldValue, MultipleValuesCustomField, K, TestSelfRelatingModel, AccountAccountAffiliation, AccountContactAffiliation, Account, Autoresponder, AutoresponderEmailMessageContent, SavedCalendar, Campaign, CampaignEmailMessageContent, Comment, ContactState, ContactWebForm, Conversation, ConversationParticipant, EmailAccount, EmailBox, EmailFolder, EmailMessage, EmailMessageActivity, EmailMessageContactVariableContent, EmailMessageRecipient, EmailMessageSender, EmailMessageSendError, EmailMessageUrl, EmailTemplate, EmailTemplateModelTestItem, EmailTemplateModelTestItem2, ExportItem, GameReward, GameBadge, GameCoin, GameCollection, GameLevel, GameNotification, GamePoint, GameScore, Dashboard, Import, JobInProcess, JobLog, StuckJob, MarketingList, PersonWhoHaveNotReadLatest, Meeting, Mission, Note, Notification, Opportunity, Product, ProductCatalog, ProductCategory, ProductTemplate, SellPriceFormula, Project, SavedReport, ReportModelTestItem, ReportModelTestItem7, SendGridEmailAccount, SocialItem, Task, TaskCheckListItem, User, SavedWorkflow, WorkflowModelTestItem, WorkflowModelTestItem7, Address, AuditEvent, Currency, CurrencyValue, Email, FileModel, Group, Permission, Person, Policy, Right, Role, SavedSearch, OwnedSecurableTestItem, and OwnedSecurableTestItem3.

Definition at line 1262 of file RedBeanModel.php.

__get ( attributeName  ) 

Exposes the members and relations of the model as if they were actual attributes of the model. See __set().

Parameters:
$attributeName A non-empty string that is the name of a member or relation.
See also:
attributeNames()
Returns:
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 in Group, NamedSecurableItem, OwnedMultipleValuesCustomField, Permission, and SecurableItem.

Definition at line 1277 of file RedBeanModel.php.

unrestrictedGet ( attributeName  )  [protected]

A protected version of __get() for models to talk to themselves to use their dynamically created members from 'members' and 'relations' in its metadata.

Reimplemented in CustomFieldsModel.

Definition at line 1287 of file RedBeanModel.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 in BaseCustomField, EmailTemplate, GamePoint, Task, Group, Item, OwnedCustomField, OwnedModel, OwnedMultipleValuesCustomField, OwnedSecurableItem, Permission, and SecurableItem.

Definition at line 1426 of file RedBeanModel.php.

unrestrictedSet ( attributeName,
value 
) [protected]

A protected version of __set() for models to talk to themselves to use their dynamically created members from 'members' and 'relations' in its metadata.

Definition at line 1450 of file RedBeanModel.php.

__isset ( attributeName  ) 

Allows testing of the members and relations of the model as if they were actual attributes of the model.

Definition at line 1547 of file RedBeanModel.php.

__unset ( attributeName  ) 

Allows unsetting of the members and relations of the model as if they were actual attributes of the model.

Definition at line 1561 of file RedBeanModel.php.

attributeNames (  ) 

Returns the member and relation names defined by the extending class's getMetadata() method.

Definition at line 1572 of file RedBeanModel.php.

isAttribute ( attributeName  ) 

Returns true if the named attribute is one of the member or relation names defined by the extending class's getMetadata() method.

Definition at line 1582 of file RedBeanModel.php.

isAttributeWithLowerCaseConversion ( attributeName  ) 

Check if attribute name exist, but ignore case sensitivity This is used by designer to make difference for example between firstValue and firstvalue, because regular isAttribute methoed doesn't make difference. In most case you would want to use isAttribute method.

Parameters:
string $attributeName
Returns:
bool

Definition at line 1595 of file RedBeanModel.php.

isAttributeReadOnly ( attributeName  ) 

Returns true if the attribute is read-only.

Definition at line 1608 of file RedBeanModel.php.

isAttributeFormattedAsProbability ( attributeName  ) 

Returns true if the attribute is formattted as probability

Definition at line 1627 of file RedBeanModel.php.

isAllowedToSetReadOnlyAttribute ( attributeName  ) 
Parameters:
boolean $attributeName
Returns:
true/false whether the attributeName specified, it is allowed to be set externally even though it is a read-only attribute.

Reimplemented in AccountContactAffiliation, Account, Contact, Opportunity, User, and Item.

Definition at line 1648 of file RedBeanModel.php.

rules (  ) 

See the yii documentation. Not used by RedBeanModel.

See also:
getMetadata()

Definition at line 1657 of file RedBeanModel.php.

behaviors (  ) 

See the yii documentation.

Definition at line 1665 of file RedBeanModel.php.

attributeLabels (  ) 

See the yii documentation. RedBeanModels utilize translatedAttributeLabels to store any attribute information.

Definition at line 1674 of file RedBeanModel.php.

abbreviatedAttributeLabels (  ) 

Public method

Definition at line 1682 of file RedBeanModel.php.

validate ( array $  attributeNames = null,
ignoreRequiredValidator = false 
)

Performs validation using the validators specified in the 'rules' meta data by the extending class's getMetadata() method. Validation occurs on a new model or a modified model, but only proceeds to modified related models. Once validated a model will pass validation without revalidating until it is modified. Related models are only validated if the model validates. Cyclic relationships are prevented from causing problems by the validation either stopping at a non-validating model and only proceeding to non-validated models.

See also:
RedBeanModel
Parameters:
$ignoreRequiredValidator - set to true in scenarios where you want to validate everything but the the required validator. An example is a search form.

Definition at line 1701 of file RedBeanModel.php.

beforeValidate (  )  [protected]

See the yii documentation.

Reimplemented in Campaign, Product, ProductTemplate, User, CurrencyValue, and Role.

Definition at line 1773 of file RedBeanModel.php.

afterValidate (  )  [protected]

See the yii documentation.

Reimplemented in EmailAccount, and SendGridEmailAccount.

Definition at line 1783 of file RedBeanModel.php.

onBeforeValidate ( CModelEvent $  event  ) 

See the yii documentation.

Definition at line 1791 of file RedBeanModel.php.

onAfterValidate ( event  ) 

See the yii documentation.

Definition at line 1799 of file RedBeanModel.php.

getValidatorList (  ) 

See the yii documentation.

Definition at line 1807 of file RedBeanModel.php.

getValidators ( attributeName = null  ) 

See the yii documentation.

Definition at line 1815 of file RedBeanModel.php.

forgetValidators (  ) 

Method to call to clear out validators from memory. Can help with performance. Used by async export for example.

Definition at line 1837 of file RedBeanModel.php.

createValidators (  ) 

See the yii documentation.

Definition at line 1848 of file RedBeanModel.php.

isUniqueAttributeValue ( attributeName,
value 
)

Returns true if the attribute value does not already exist in the database. This is used in the unique validator, but on saving RedBean can still throw because the unique constraint on the column has been violated because it was concurrently updated between the Yii validator being called and the save actually occuring.

Reimplemented in Currency.

Definition at line 1860 of file RedBeanModel.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 in CustomFieldData, User, Currency, Item, NamedSecurableItem, OwnedCustomField, OwnedModel, and OwnedMultipleValuesCustomField.

Definition at line 1894 of file RedBeanModel.php.

isRelatedModelReallyModified ( relatedModel,
relationType,
isOwned 
)

See Stories #82063952 and #82699138

See also:
isReallyModified
Parameters:
$relatedModel 
$relationType integer
$isOwned boolean
Returns:
bool

Definition at line 2058 of file RedBeanModel.php.

isReallyModified ( relationType,
isOwned 
)

See Stories #82063952 and #82699138 Overridden in OwnedSecurableItem. This means the fix is scoped down to just classes that extend OwnedSecurableItem, but the bug with isModified only manifests when there are default values on related models, which has only occurred on subClasses of OwnedSecurableItem.

This fix is probably temporarily until the way isModified() and save() methods work in RedBeanModel is refactored. This would be a large refactoring.

Parameters:
$relationType integer
$isOwned boolean
Returns:
bool

Reimplemented in OwnedSecurableItem.

Definition at line 2084 of file RedBeanModel.php.

beforeSave (  )  [protected]

This method is invoked before saving a record (after validation, if any). The default implementation raises the onBeforeSave event. You may override this method to do any preparation work for record saving. Use isNewModel to determine whether the saving is for inserting or updating record. Make sure you call the parent implementation so that the event is raised properly.

Returns:
boolean whether the saving should be executed. Defaults to true.

Reimplemented in Account, AutoresponderItem, Campaign, Contact, Conversation, EmailMessageActivity, MarketingListMember, Meeting, Mission, Note, Opportunity, ExternalApiEmailMessageActivity, SocialItem, Task, User, Address, FileModel, Group, Item, and Role.

Definition at line 2100 of file RedBeanModel.php.

onBeforeSave ( event  ) 

This event is raised before the record is saved. By setting CModelEvent::isValid to be false, the normal save() process will be stopped.

Parameters:
CModelEvent $event the event parameter
Since:
1.0.2

Definition at line 2126 of file RedBeanModel.php.

onAfterSave ( event  ) 

This event is raised after the record is saved.

Parameters:
CEvent $event the event parameter
Since:
1.0.2

Definition at line 2136 of file RedBeanModel.php.

onRedBeanOneToManyRelatedModelsChange ( event  ) 

This event is raised on a RedBeanOneToManyRelatedModels change

Parameters:
$event 

Definition at line 2145 of file RedBeanModel.php.

onBeforeDelete ( event  ) 

This event is raised before the record is deleted. By setting CModelEvent::isValid to be false, the normal delete() process will be stopped.

Parameters:
CModelEvent $event the event parameter
Since:
1.0.2

Definition at line 2156 of file RedBeanModel.php.

onAfterDelete ( event  ) 

This event is raised after the record is deleted.

Parameters:
CEvent $event the event parameter
Since:
1.0.2

Definition at line 2166 of file RedBeanModel.php.

isModified (  ) 

Returns true if the model has been modified since it was saved or constructed.

Definition at line 2188 of file RedBeanModel.php.

delete (  ) 

Deletes the model from the database.

Reimplemented in Item, and SecurableItem.

Definition at line 2232 of file RedBeanModel.php.

beforeDelete (  )  [protected]

This method is invoked before deleting a record. The default implementation raises the onBeforeDelete event. You may override this method to do any preparation work for record deletion. Make sure you call the parent implementation so that the event is raised properly.

Returns:
boolean whether the record should be deleted. Defaults to true.

Reimplemented in Portlet, EmailFolder, Import, Opportunity, ProductCatalog, ProductCategory, ProductTemplate, Project, User, Group, OwnedSecurableItem, and Role.

Definition at line 2268 of file RedBeanModel.php.

afterDelete (  )  [protected]

This method is invoked after deleting a record. The default implementation raises the onAfterDelete event. You may override this method to do postprocessing after the record is deleted. Make sure you call the parent implementation so that the event is raised properly.

Reimplemented in Autoresponder, AutoresponderItem, Campaign, CampaignItem, Contact, EmailMessage, EmailMessageActivity, User, Group, and Role.

Definition at line 2288 of file RedBeanModel.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 in KanbanItem, FileContent, A, ExtendsNoBean, M, MixedRelationsModel, P, PP, PPP, PPPP, TestModelJoinHasManyAndHasOneBelongsToSide, TestModelJoinHasManySide, TestModelJoinHasOneSide, TestModelJoinManyManySide, TestModelJoinManyManySideTwo, TestModelToMessagesModel, TestPolyOneToManyOneSide, TestPolyOneToManyOneSideTwo, TestPolyOneToManyPolySide, TestPolyOneToManyPolySideOwned, X, AccountAccountAffiliation, AccountContactAffiliation, Account, Activity, ApiTestModelItem, ApiTestModelItem2, ApiTestModelItem3, ApiTestModelItem4, Autoresponder, AutoresponderEmailMessageContent, AutoresponderItem, SavedCalendar, Campaign, CampaignEmailMessageContent, CampaignItem, Comment, Contact, ContactWebForm, ContactWebFormEntry, Conversation, ConversationParticipant, EmailAccount, EmailBox, EmailFolder, EmailMessage, EmailMessageActivity, EmailMessageContactVariableContent, EmailMessageContent, EmailMessageRecipient, EmailMessageSender, EmailMessageSendError, EmailMessageUrl, EmailSignature, EmailTemplate, EmailTemplateModelTestItem, EmailTemplateModelTestItem2, ExportItem, ExportTestModelItem, ExportTestModelItem2, ExportTestModelItem3, ExportTestModelItem4, ExportTestModelItem5, ExportTestModelItem6, GameReward, GameBadge, GameCoin, GameCollection, GameLevel, GameNotification, GamePoint, GameScore, Dashboard, Import, ImportDedupeModelTestItem, ImportModelTestItem, ImportModelTestItem2, ImportModelTestItem3, ImportModelTestItem4, ImportModelTestItem5, JobInProcess, JobLog, StuckJob, MarketingList, MarketingListMember, PersonWhoHaveNotReadLatest, Meeting, Mission, Note, Notification, NotificationMessage, Opportunity, Product, ProductCatalog, ProductCategory, ProductTemplate, SellPriceFormula, Project, SavedReport, ReportModelTestItem, ReportModelTestItem10, ReportModelTestItem11, ReportModelTestItem12, ReportModelTestItem2, ReportModelTestItem3, ReportModelTestItem4, ReportModelTestItem5, ReportModelTestItem6, ReportModelTestItem7, ReportModelTestItem8, ReportModelTestItem9, SendGridEmailAccount, SocialItem, Task, User, ByTimeWorkflowInQueue, SavedWorkflow, WorkflowMessageInQueue, WorkflowModelTestItem, WorkflowModelTestItem2, WorkflowModelTestItem3, WorkflowModelTestItem4, WorkflowModelTestItem5, WorkflowModelTestItem6, WorkflowModelTestItem7, WorkflowModelTestItem8, WorkflowModelTestItem9, Address, BaseStarredModel, Currency, CurrencyValue, Email, FileModel, Group, Item, NamedSecurableItem, OwnedModel, OwnedSecurableItem, Permission, Permitable, Person, Policy, Right, Role, SavedSearch, SecurableItem, ModelToArrayAdapterTestItem, ModelToArrayAdapterTestItem2, ModelToArrayAdapterTestItem3, ModelToArrayAdapterTestItem4, ModelWithAttachmentTestItem, OwnedSecurableTestItem, OwnedSecurableTestItem3, and TestOwnedLinkSpecificModel.

Definition at line 2422 of file RedBeanModel.php.

isDeletable (  ) 

To be overridden by derived classes to prevent deletion.

Reimplemented in EmailBox, User, and Group.

Definition at line 2431 of file RedBeanModel.php.

static forgetAll (  )  [static]

Forgets about all of the objects so that when they are retrieved again they will be recreated from the database. For use in testing.

Definition at line 2440 of file RedBeanModel.php.

forget (  ) 

Forgets about the object so that if it is retrieved again it will be recreated from the database. For use in testing.

Definition at line 2452 of file RedBeanModel.php.

isAttributeRequired ( attributeName  ) 

See the yii documentation.

Definition at line 2462 of file RedBeanModel.php.

isAttributeSafe ( attributeName  ) 

See the yii documentation.

Definition at line 2478 of file RedBeanModel.php.

static getLabel ( language = null  )  [static, protected]

Returns the display name for the model class. Defaults to the module label. Override if the model label is not the module label. Make sure to return a translated label. Also provides fall back in moduleClassName is null.

Parameters:
null | string $language
Returns:
dynamic label name based on module.

Reimplemented in A, X, AccountAccountAffiliation, AccountContactAffiliation, AccountStarred, Autoresponder, AutoresponderEmailMessageContent, AutoresponderItem, AutoresponderItemActivity, Campaign, CampaignEmailMessageContent, CampaignItem, CampaignItemActivity, Contact, ContactStarred, ContactWebForm, ContactWebFormEntry, ConversationParticipant, ConversationStarred, EmailAccount, EmailBox, EmailFolder, EmailMessage, EmailMessageActivity, EmailMessageContactVariableContent, EmailMessageContent, EmailMessageRecipient, EmailMessageSender, EmailMessageSendError, EmailMessageUrl, EmailSignature, EmailTemplate, EmailTemplateModelTestItem2, GameRewardTransaction, GameBadge, GameCoin, GameCollection, GameLevel, GameNotification, GamePoint, GamePointTransaction, GameScore, Dashboard, ImportDedupeModelTestItem, ImportModelTestItem2, ImportModelTestItem3, ImportModelTestItem4, ImportModelTestItem5, JobInProcess, JobLog, StuckJob, MarketingList, MarketingListMember, NotificationMessage, OpportunityStarred, ProductCatalog, ProductCategory, ProductTemplate, ProjectStarred, SavedReportStarred, ReportModelTestItem10, ReportModelTestItem11, ReportModelTestItem12, ReportModelTestItem2, ReportModelTestItem3, ReportModelTestItem4, ReportModelTestItem5, ReportModelTestItem6, ReportModelTestItem7, ReportModelTestItem8, ReportModelTestItem9, ExternalApiEmailMessageActivity, SendGridEmailAccount, ByTimeWorkflowInQueue, WorkflowMessageInQueue, WorkflowModelTestItem2, WorkflowModelTestItem3, WorkflowModelTestItem4, WorkflowModelTestItem5, WorkflowModelTestItem6, WorkflowModelTestItem7, WorkflowModelTestItem8, WorkflowModelTestItem9, Address, BaseStarredModel, Currency, Email, Person, SavedSearch, and TestOwnedLinkSpecificModel.

Definition at line 2512 of file RedBeanModel.php.

static getPluralLabel ( language = null  )  [static, protected]

Returns the display name for plural of the model class. Defaults to the module label. Override if the model label is not the module label. Make sure to return a translated label

Parameters:
null | string $language
Returns:
dynamic label name based on module.

Reimplemented in A, X, AccountAccountAffiliation, AccountContactAffiliation, AccountStarred, Autoresponder, AutoresponderEmailMessageContent, AutoresponderItem, AutoresponderItemActivity, Campaign, CampaignEmailMessageContent, CampaignItem, CampaignItemActivity, Contact, ContactStarred, ContactWebForm, ContactWebFormEntry, ConversationParticipant, ConversationStarred, EmailAccount, EmailBox, EmailFolder, EmailMessage, EmailMessageActivity, EmailMessageContactVariableContent, EmailMessageContent, EmailMessageRecipient, EmailMessageSender, EmailMessageSendError, EmailMessageUrl, EmailSignature, EmailTemplate, EmailTemplateModelTestItem2, GameRewardTransaction, GameBadge, GameCoin, GameCollection, GameLevel, GameNotification, GamePoint, GamePointTransaction, GameScore, Dashboard, ImportDedupeModelTestItem, ImportModelTestItem2, ImportModelTestItem3, ImportModelTestItem4, ImportModelTestItem5, JobInProcess, JobLog, StuckJob, MarketingList, MarketingListMember, NotificationMessage, OpportunityStarred, ProductCatalog, ProductCategory, ProductTemplate, ProjectStarred, SavedReportStarred, ReportModelTestItem10, ReportModelTestItem11, ReportModelTestItem12, ReportModelTestItem2, ReportModelTestItem3, ReportModelTestItem4, ReportModelTestItem5, ReportModelTestItem6, ReportModelTestItem7, ReportModelTestItem8, ReportModelTestItem9, ExternalApiEmailMessageActivity, SendGridEmailAccount, ByTimeWorkflowInQueue, WorkflowMessageInQueue, WorkflowModelTestItem2, WorkflowModelTestItem3, WorkflowModelTestItem4, WorkflowModelTestItem5, WorkflowModelTestItem6, WorkflowModelTestItem7, WorkflowModelTestItem8, WorkflowModelTestItem9, Address, BaseStarredModel, Email, Person, SavedSearch, and TestOwnedLinkSpecificModel.

Definition at line 2527 of file RedBeanModel.php.

getAttributeLabel ( attributeName  ) 

See the yii documentation.

Definition at line 2539 of file RedBeanModel.php.

static getAnAttributeLabel ( attributeName  )  [static]

Static implementation of

See also:
getAttributeLabel

Definition at line 2547 of file RedBeanModel.php.

static getAttributeLabelByLanguage ( attributeName,
language 
) [static, protected]

Given an attributeName and a language, retrieve the translated attribute label. Attempts to find a customized label in the metadata first, before falling back on the standard attribute label for the specified attribute.

Returns:
string - translated attribute label

Definition at line 2557 of file RedBeanModel.php.

static getTranslatedCustomAttributeLabelByLanguage ( attributeName,
languageCode 
) [static, protected]

Given an attributeName, attempt to find in the metadata a custom attribute label for the given language.

Returns:
string - translated attribute label, if not found return null.

Definition at line 2589 of file RedBeanModel.php.

getAttributeLabelsForAllActiveLanguagesByAttributeName ( attributeName  ) 

Given an attributeName, return an array of all attribute labels for each active language.

Returns:
array - attribute labels by language for the given attributeName.

Definition at line 2610 of file RedBeanModel.php.

hasErrors ( attributeNameOrNames = null  ) 

See the yii documentation. The yii hasErrors() takes an optional attribute name. RedBeanModel's hasErrors() takes an optional attribute name or array of attribute names. See getErrors() for an explanation of this difference.

Definition at line 2627 of file RedBeanModel.php.

getErrors ( attributeNameOrNames = null  ) 

See the yii documentation. The yii getErrors() takes an optional attribute name. RedBeanModel's getErrors() takes an optional attribute name or array of attribute names.

Parameters:
@attributeNameOrNames Either null, return all errors on the model and its related models, an attribute name on the model, return errors on that attribute, or an array of relation and attribute names, return errors on a related model's attribute.

Reimplemented in Campaign.

Definition at line 2726 of file RedBeanModel.php.

getError ( attributeName  ) 

See the yii documentation.

Definition at line 2819 of file RedBeanModel.php.

addError ( attributeName,
errorMessage 
)

See the yii documentation.

Definition at line 2828 of file RedBeanModel.php.

addErrors ( array $  errors  ) 

See the yii documentation.

Definition at line 2841 of file RedBeanModel.php.

clearErrors ( attributeName = null  ) 

See the yii documentation.

Definition at line 2866 of file RedBeanModel.php.

generateAttributeLabel ( attributeName  ) 

See the yii documentation.

Definition at line 2882 of file RedBeanModel.php.

getAttributes ( array $  attributeNames = null  ) 

See the yii documentation.

Definition at line 2891 of file RedBeanModel.php.

setAttributes ( array $  values,
safeOnly = true 
)

See the yii documentation.

Definition at line 2920 of file RedBeanModel.php.

unsetAttributes ( attributeNames = null  ) 

See the yii documentation.

Definition at line 2982 of file RedBeanModel.php.

onUnsafeAttribute ( name,
value 
)

See the yii documentation.

Definition at line 2997 of file RedBeanModel.php.

getScenario (  ) 

See the yii documentation.

Definition at line 3009 of file RedBeanModel.php.

setScenario ( scenarioName  ) 

See the yii documentation.

Definition at line 3017 of file RedBeanModel.php.

getSafeAttributeNames (  ) 

See the yii documentation.

Definition at line 3026 of file RedBeanModel.php.

getIterator (  ) 

See the yii documentation.

Definition at line 3057 of file RedBeanModel.php.

offsetExists ( offset  ) 

See the yii documentation.

Definition at line 3065 of file RedBeanModel.php.

offsetGet ( offset  ) 

See the yii documentation.

Definition at line 3073 of file RedBeanModel.php.

offsetSet ( offset,
item 
)

See the yii documentation.

Definition at line 3081 of file RedBeanModel.php.

offsetUnset ( offset  ) 

See the yii documentation.

Definition at line 3089 of file RedBeanModel.php.

static makeModel ( RedBean_OODBBean $  bean,
modelClassName = null 
) [static]

Creates an instance of the extending model wrapping the given bean. For use only by models. Beans are never used by the application directly.

Parameters:
$bean A RedBean bean.
$modelClassName Pass only when getting it at runtime gets the wrong name.
Returns:
An instance of the type of the extending model.

Definition at line 3104 of file RedBeanModel.php.

static makeModels ( array $  beans,
modelClassName = null 
) [static]

Creates an array of instances of the named model type wrapping the given beans. For use only by models. Beans are never used by the application directly.

Parameters:
$beans An array of RedBean beans.
$modelClassName Pass only when getting it at runtime gets the wrong name.
Returns:
An array of instances of the type of the extending model.

Definition at line 3135 of file RedBeanModel.php.

stringifyOneToManyRelatedModelsValues ( values  ) 

Given an array of data, create stringified content.

Parameters:
array $values

Reimplemented in MultipleValuesCustomField.

Definition at line 3165 of file RedBeanModel.php.

static resolveModelClassNameForClassesWithoutBeans ( &$  modelClassName  )  [static, protected]

Resolve and get model class name used for table retrieval factoring in when a class does not have a bean and must use a parent class

Parameters:
string $modelClassName

Definition at line 3176 of file RedBeanModel.php.

static getSortAttributesByAttribute ( attribute  )  [static]

Returns a list of attributes to be added when sorting by the attribute

Parameters:
string $attribute
Returns:
array

Reimplemented in Q, User, and Person.

Definition at line 3202 of file RedBeanModel.php.

setIsCopied (  ) 

Utilized by copy mechanism, helps elements, views, understand the model better before the new model is saved.

Definition at line 3210 of file RedBeanModel.php.

isCopied (  ) 
Returns:
bool

Definition at line 3218 of file RedBeanModel.php.

static isCacheable (  )  [static]
Returns:
bool

Reimplemented in FileContent, and Opportunity.

Definition at line 3226 of file RedBeanModel.php.

addValidator ( attribute,
validator,
params = array() 
)

Wrapper for CValidator::createValidator

Parameters:
$attribute 
$validator 
array $params

Definition at line 3242 of file RedBeanModel.php.

static relationLinksToPrecedingRelation ( modelClassName,
relation,
precedingModelClassName = null,
precedingRelation = null 
) [static]
Parameters:
string $modelClassName
string $relation
null|string $precedingModelClassName
null|string $precedingRelation
Returns:
bool

Definition at line 3274 of file RedBeanModel.php.

static allowMemcacheCache (  )  [static]

Whether or not this model instances should be cached in memcache

Returns:
bool

Reimplemented in FileContent.

Definition at line 3315 of file RedBeanModel.php.


Field Documentation

Character used as delimiter when generating model identifiers

Definition at line 72 of file RedBeanModel.php.

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

Reimplemented from BeanModel.

Reimplemented in CustomFieldsModel, and OwnedModel.

Definition at line 101 of file RedBeanModel.php.


The documentation for this class was generated from the following file:
 All Data Structures Functions Variables
Generated on Fri Aug 23 07:11:05 2019