Account Suspended
Account Suspended
This Account has been suspended.
Contact your hosting provider for more information.
 All Data Structures Functions Variables Pages
Static Public Member Functions | Data Fields | Static Protected Member Functions | Static Protected Attributes
BeanModel Class Reference
Inheritance diagram for BeanModel:
ObservableComponent RedBeanModel 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

Static Public Member Functions

static getCanHaveBean ()
 
static getMetadata ()
 
static isAnAttribute ($attributeName)
 
static resolveAttributeModelClassName ($attributeName)
 
static getAttributeModelClassName ($attributeName)
 
static isRelation ($attributeName)
 
static isOwnedRelation ($attributeName)
 
static getRelationType ($relationName)
 
static getRelationModelClassName ($relationName)
 
static getRelationLinkType ($relationName)
 
static getRelationLinkName ($relationName)
 
static isRelationTypeAHasManyVariant ($relationName)
 
static isRelationTypeAHasOneVariant ($relationName)
 
static isADerivedRelationViaCastedUpModel ($relationName)
 
static getDerivedRelationType ($relationName)
 
static getDerivedRelationModelClassName ($relationName)
 
static getDerivedRelationViaCastedUpModelOpposingRelationName ($relationName)
 
static getInferredRelationModelClassNamesForRelation ($relation)
 
static getColumnNameByAttribute ($attributeName)
 
static getAttributeNames ()
 
static generateAnAttributeLabel ($attributeName)
 
static getAbbreviatedAttributeLabel ($attributeName)
 
static getTranslatedAttributeLabels ($language)
 
static getMixedInModelClassNames ()
 
static isRelationTypeAManyManyVariant ($relationName)
 

Data Fields

const HAS_ONE_BELONGS_TO = 0
 
const HAS_MANY_BELONGS_TO = 1
 
const HAS_ONE = 2
 
const HAS_MANY = 3
 
const MANY_MANY = 4
 
const OWNED = true
 
const NOT_OWNED = false
 
const CACHE_IDENTIFIER = 'BeanModelMapping'
 
const LINK_TYPE_ASSUMPTIVE = 0
 
const LINK_TYPE_SPECIFIC = 1
 
const LINK_TYPE_POLYMORPHIC = 2
 

Static Protected Member Functions

static translatedAbbreviatedAttributeLabels ($language)
 
static translatedAttributeLabels ($language)
 
static getAttributeNamesToClassNamesForModel ()
 
static getAttributeNamesNotBelongsToOrManyManyForModel ()
 
static getRelationNameToRelationTypeModelClassNameAndOwnsForModel ()
 
static getDerivedRelationNameToTypeModelClassNameAndOppposingRelationForModel ()
 
static forgetBeanModel ($modelClassName)
 
static forgetAllBeanModels ()
 
static resolveCacheAndMapMetadataForAllClassesInHeirarchy ()
 
static resolveCachedMetadataForIntegrity ($cachedData)
 
static resolveLinkTypeAndRelationLinkName ($relationTypeModelClassNameAndOwns, &$linkType, &$relationLinkName)
 

Static Protected Attributes

static $lastClassInBeanHeirarchy = 'BeanModel'
 

Additional Inherited Members

- Public Member Functions inherited from ObservableComponent
 init ()
 
 attachEvents ($events)
 
 events ()
 
 attachEventHandler ($name, $handler)
 
 detachEventHandler ($name, $handler)
 

Detailed Description

Base class for working with models. Handles mapping and caching of metadata and attribute information.

Definition at line 40 of file BeanModel.php.

Member Function Documentation

static getCanHaveBean ( )
static
Returns
boolean

Definition at line 159 of file BeanModel.php.

static getMetadata ( )
static

Implement in children classes

Exceptions
NotImplementedException

Definition at line 168 of file BeanModel.php.

static isAnAttribute (   $attributeName)
static

Static alternative to using isAttribute which is a concrete method.

Parameters
$attributeName
Returns
bool

Definition at line 178 of file BeanModel.php.

static resolveAttributeModelClassName (   $attributeName)
static

This method is needed to interpret when the attributeName is 'id'. Since id is not an attribute on the model, we manaully check for this and return the appropriate class name.

Parameters
string$attributeName
Returns
the model class name for the attribute. This could be a casted up model class name.

Definition at line 191 of file BeanModel.php.

static getAttributeModelClassName (   $attributeName)
static

Returns the model class name for an attribute name defined by the extending class's getMetadata() method. For use by RedBeanModelDataProvider. Is unlikely to be of any use to an application.

Parameters
string$attributeName

Definition at line 208 of file BeanModel.php.

static isRelation (   $attributeName)
static

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

Definition at line 220 of file BeanModel.php.

static isOwnedRelation (   $attributeName)
static

Returns true if the named attribute is one of the relation names defined by the extending class's getMetadata() method, and specifies RedBeanModel::OWNED.

Definition at line 231 of file BeanModel.php.

static getRelationType (   $relationName)
static

Returns the relation type relation name defined by the extending class's getMetadata() method.

Definition at line 243 of file BeanModel.php.

static getRelationModelClassName (   $relationName)
static

Returns the model class name for a relation name defined by the extending class's getMetadata() method. For use by RedBeanModelDataProvider. Is unlikely to be of any use to an application.

Definition at line 256 of file BeanModel.php.

static getRelationLinkType (   $relationName)
static

Returns the link type for a relation name defined by the extending class's getMetadata() method.

Definition at line 267 of file BeanModel.php.

static getRelationLinkName (   $relationName)
static

Returns the link name for a relation name defined by the extending class's getMetadata() method.

Parameters
string$relationName

Definition at line 279 of file BeanModel.php.

static isRelationTypeAHasManyVariant (   $relationName)
static
Parameters
string$relationName
Returns
bool

Definition at line 290 of file BeanModel.php.

static isRelationTypeAHasOneVariant (   $relationName)
static
Parameters
string$relationName
Returns
bool

Definition at line 305 of file BeanModel.php.

static isADerivedRelationViaCastedUpModel (   $relationName)
static
Parameters
string$relationName
Returns
boolean true if the relation is a derived relation

Definition at line 320 of file BeanModel.php.

static getDerivedRelationType (   $relationName)
static

Returns the relation type of a derived relation defined by the extending class's getMetadata() method.

Parameters
string$relationName

Definition at line 335 of file BeanModel.php.

static getDerivedRelationModelClassName (   $relationName)
static

Returns the relation model class name of a derived relation defined by the extending class's getMetadata() method.

Parameters
string$relationName

Definition at line 347 of file BeanModel.php.

static getDerivedRelationViaCastedUpModelOpposingRelationName (   $relationName)
static

Returns the opposing relation name of a derived relation defined by the extending class's getMetadata() method.

Definition at line 358 of file BeanModel.php.

static getInferredRelationModelClassNamesForRelation (   $relation)
static
Parameters
$relation
Returns
null|string

Definition at line 369 of file BeanModel.php.

static getColumnNameByAttribute (   $attributeName)
static

Given an attribute return the column name.

Parameters
string$attributeName
Returns
string

Definition at line 387 of file BeanModel.php.

static getAttributeNames ( )
static

Static implementation of attributeNames()

Definition at line 405 of file BeanModel.php.

static generateAnAttributeLabel (   $attributeName)
static

Static implementation of generateAttributeLabel()

Definition at line 413 of file BeanModel.php.

static getAbbreviatedAttributeLabel (   $attributeName)
static

Given an attributeName, 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.

Parameters
string$attributeName
Returns
string - translated attribute label

Definition at line 424 of file BeanModel.php.

static getTranslatedAttributeLabels (   $language)
static

Public for message checker only

Parameters
$language
Returns
array;

Definition at line 444 of file BeanModel.php.

static translatedAbbreviatedAttributeLabels (   $language)
staticprotected

Array of untranslated abbreviated attribute labels.

Definition at line 452 of file BeanModel.php.

static getMixedInModelClassNames ( )
static
Returns
array

Definition at line 465 of file BeanModel.php.

static getAttributeNamesToClassNamesForModel ( )
staticprotected
Returns
array

Definition at line 473 of file BeanModel.php.

static getAttributeNamesNotBelongsToOrManyManyForModel ( )
staticprotected
Returns
array

Definition at line 485 of file BeanModel.php.

static getRelationNameToRelationTypeModelClassNameAndOwnsForModel ( )
staticprotected
Returns
array

Definition at line 497 of file BeanModel.php.

static getDerivedRelationNameToTypeModelClassNameAndOppposingRelationForModel ( )
staticprotected
Returns
array

Definition at line 509 of file BeanModel.php.

static forgetBeanModel (   $modelClassName)
staticprotected
Parameters
string$modelClassName

Definition at line 521 of file BeanModel.php.

static resolveCachedMetadataForIntegrity (   $cachedData)
staticprotected

This function only exists because there is a strange bug in GameBadge and GameScore metadata where the metadata is getting cached, but then it is missing everything except empty arrays. Since we don't know why this happens, this hack is the only way to ensure the cache returned is treated as non existant.

See Also
override in GameBagde and GameScore.
Parameters
$cachedData

Definition at line 590 of file BeanModel.php.

static isRelationTypeAManyManyVariant (   $relationName)
static
Parameters
string$relationName
Returns
bool

Definition at line 728 of file BeanModel.php.

Field Documentation

const HAS_ONE_BELONGS_TO = 0

Used in an extending class's getDefaultMetadata() method to specify that a relation is 1:1 and that the class on the side of the relationship where this is not a column in that model's table. Example: model X HAS_ONE Y. There will be a y_id on the x table. But in Y you would have HAS_ONE_BELONGS_TO X and there would be no column in the y table.

Definition at line 48 of file BeanModel.php.

const HAS_MANY_BELONGS_TO = 1

Used in an extending class's getDefaultMetadata() method to specify that a relation is 1:M and that the class on the M side of the relation. Note: Currently if you have a relation that is set to HAS_MANY_BELONGS_TO, then that relation name must be the strtolower() same as the related model class name. This is the current support for this relation type. If something different is set, an exception will be thrown.

Definition at line 58 of file BeanModel.php.

const HAS_ONE = 2

Used in an extending class's getDefaultMetadata() method to specify that a relation is 1:1.

Definition at line 64 of file BeanModel.php.

const HAS_MANY = 3

Used in an extending class's getDefaultMetadata() method to specify that a relation is 1:M and that the class is on the 1 side of the relation.

Definition at line 71 of file BeanModel.php.

const MANY_MANY = 4

Used in an extending class's getDefaultMetadata() method to specify that a relation is M:N and that the class on the either side of the relation.

Definition at line 78 of file BeanModel.php.

const OWNED = true

Used in an extending class's getDefaultMetadata() method to specify that a 1:1 or 1:M relation is one in which the left side of the relation owns the model or models on the right side, meaning that if the model is deleted it owns the related models and they are deleted along with it. If not specified the related model is independent and is not deleted.

Definition at line 87 of file BeanModel.php.

$lastClassInBeanHeirarchy = 'BeanModel'
staticprotected
See Also
RedBeanModel::$lastClassInBeanHeirarchy

Definition at line 127 of file BeanModel.php.


The documentation for this class was generated from the following file:
Generated on Mon Nov 30 2020 07:10:51
Account Suspended
Account Suspended
This Account has been suspended.
Contact your hosting provider for more information.