GamePoint Class Reference

Inheritance diagram for GamePoint:
Item CustomFieldsModel RedBeanModel BeanModel ObservableComponent

Public Member Functions

 __toString ()
 __set ($attributeName, $value)
 addValue ($value, $createTransaction=true)
 replaceValue ($value)

Static Public Member Functions

static resolveToGetByTypeAndPerson ($type, Item $person)
static getAllByPersonIndexedByType (Item $person)
static getModuleClassName ()
static canSaveMetadata ()
static getDefaultMetadata ()
static isTypeDeletable ()
static doesUserExceedPointsByLevelType (User $user, $points, $levelType)
static getSummationPointsDataByLevelTypeAndUser (User $user, $levelType)
static getSummationPointsDataByUserIndexedByLevelType (User $user)

Data Fields

const TYPE_USER_ADOPTION = 'UserAdoption'
const TYPE_SALES = 'Sales'
const TYPE_NEW_BUSINESS = 'NewBusiness'
const TYPE_ACCOUNT_MANAGEMENT = 'AccountManagement'
const TYPE_COMMUNICATION = 'Communication'
const TYPE_TIME_MANAGEMENT = 'TimeManagement'

Static Protected Member Functions

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

Protected Attributes

 $isAudited = false

Detailed Description

Model for game points.

Definition at line 40 of file GamePoint.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.

A string.

Reimplemented from RedBeanModel.

Definition at line 74 of file GamePoint.php.

__set ( attributeName,

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');
$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 Item.

Definition at line 83 of file GamePoint.php.

static resolveToGetByTypeAndPerson ( type,
Item person 
) [static]

Given a point type and Item (Either User or Person), try to find an existing model. If the model does not exist, create it and populate the Item and type.

The found or created model.
string $type
Item $person

Definition at line 101 of file GamePoint.php.

static getAllByPersonIndexedByType ( Item person  )  [static]

Given a Item (Either User or Person), Try to find an existing models and index the returning array by point type.

Item $person

Definition at line 145 of file GamePoint.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 175 of file GamePoint.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 Item.

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

Definition at line 216 of file GamePoint.php.

addValue ( value,
createTransaction = true 

Add specified value.

bool $createTransaction

Definition at line 226 of file GamePoint.php.

replaceValue ( value  ) 

Replace value with specified value.

int $value

Definition at line 243 of file GamePoint.php.

static doesUserExceedPointsByLevelType ( User user,
) [static]

Given a user and a number, determine if a user's existing total points exceeds the specified number. If so, return true, otherwise return false.

User $user
Integer $points

Definition at line 259 of file GamePoint.php.

static getSummationPointsDataByLevelTypeAndUser ( User user,
) [static]
User $user
string $levelType

Definition at line 280 of file GamePoint.php.

static getSummationPointsDataByUserIndexedByLevelType ( User user  )  [static]

Performance function to grab all summation data by type for a given user.

User $user
array of summation points indexed by the level type

Definition at line 295 of file GamePoint.php.

static getPointTypeWherePartByLevelType ( levelType  )  [static, protected]

Given a level type, get the corresponding where sql part to filter by point type if applicable. Level types match point types for now, so if the level type is not valid then it will thrown an exception.

string $levelType

Definition at line 315 of file GamePoint.php.

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

Returns the display name for the model class.

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

Reimplemented from RedBeanModel.

Definition at line 343 of file GamePoint.php.

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

Returns the display name for plural of the model class.

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

Reimplemented from RedBeanModel.

Definition at line 353 of file GamePoint.php.

The documentation for this class was generated from the following file:
 All Data Structures Functions Variables
Generated on Mon Nov 18 07:10:52 2019