GameNotification Class Reference

Inheritance diagram for GameNotification:
RedBeanModel BeanModel ObservableComponent

Public Member Functions

 __toString ()
 setLevelChangeByNextLevelValue ($nextLevelValue, $coinsValue)
 setNewBadgeByType ($badgeType)
 setBadgeGradeChangeByTypeAndNewGrade ($badgeType, $newGrade)
 getUnserializedData ()

Static Public Member Functions

static getAllByUser (User $user)
static getModuleClassName ()
static canSaveMetadata ()
static getDefaultMetadata ()
static isTypeDeletable ()

Data Fields

const TYPE_LEVEL_CHANGE = 'LevelChange'
const TYPE_NEW_BADGE = 'NewBadge'
const TYPE_BADGE_GRADE_CHANGE = 'GradeChange'

Static Protected Member Functions

static getLabel ($language=null)
static getPluralLabel ($language=null)

Detailed Description

Model for game notification data

Definition at line 40 of file GameNotification.php.


Member Function Documentation

__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 from RedBeanModel.

Definition at line 48 of file GameNotification.php.

static getAllByUser ( User user  )  [static]

Given a user, retrieval all notifications for that user, sorted desc by Id

Parameters:
User $user
Returns:
array $models

Definition at line 58 of file GameNotification.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 from RedBeanModel.

Definition at line 82 of file GameNotification.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.

Definition at line 87 of file GameNotification.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.

Definition at line 106 of file GameNotification.php.

setLevelChangeByNextLevelValue ( nextLevelValue,
coinsValue 
)

Sets the serializedData for a notification when a new level is reached

Parameters:
integer $nextLevelValue
integer $coinsValue

Definition at line 116 of file GameNotification.php.

setNewBadgeByType ( badgeType  ) 

Sets the serializedData for a notification when a new badge is received.

Parameters:
string $badgeType

Definition at line 132 of file GameNotification.php.

setBadgeGradeChangeByTypeAndNewGrade ( badgeType,
newGrade 
)

Sets the serializedData for a notification when a badge grade changes.

Parameters:
string $badgeType
integer $newGrade

Definition at line 143 of file GameNotification.php.

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

Returns the display name for the model class.

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

Reimplemented from RedBeanModel.

Definition at line 162 of file GameNotification.php.

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

Returns the display name for plural of the model class.

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

Reimplemented from RedBeanModel.

Definition at line 172 of file GameNotification.php.


The documentation for this class was generated from the following file:
 All Data Structures Functions Variables
Generated on Wed Mar 29 07:10:26 2017