Overview

Packages

  • None
  • Yaga

Classes

  • ActedModel
  • ActionController
  • ActionModel
  • AwardCombo
  • BadgeAwardModel
  • BadgeController
  • BadgeModel
  • BadgesController
  • BadgesModule
  • BestController
  • BestFilterModule
  • CakeDayPost
  • CommentCount
  • CommentMarathon
  • DiscussionBodyLength
  • DiscussionCategory
  • DiscussionCount
  • DiscussionPageCount
  • HasMentioned
  • HolidayVisit
  • LeaderBoardModule
  • LengthOfService
  • ManualAward
  • NecroPost
  • NewbieComment
  • PhotoExists
  • PostCount
  • PostReactions
  • QnAAnserCount
  • RankController
  • RankModel
  • ReactController
  • ReactionCount
  • ReactionModel
  • ReflexComment
  • RulesController
  • SocialConnection
  • Yaga
  • YagaController
  • YagaHooks

Interfaces

  • YagaRule
  • Overview
  • Package
  • Class
  • Tree
  • Todo
  • Download

Class BadgeAwardModel

Handles badge awards

Events:

Gdn_Model
Extended by BadgeAwardModel
Package: Yaga
Since: 1.0
Located at models/class.badgeawardmodel.php
Methods summary
public
# __construct( )

Defines the related database table name.

Defines the related database table name.

public integer
# GetCount( integer $BadgeID = FALSE )

Gets the number of badges that have been awarded with a specific ID

Gets the number of badges that have been awarded with a specific ID

Parameters

$BadgeID
integer
$BadgeID

Returns

integer
public dataset
# GetRecent( integer $BadgeID, integer $Limit = 15 )

Gets recently awarded badges with a specific ID

Gets recently awarded badges with a specific ID

Parameters

$BadgeID
integer
$BadgeID
$Limit
integer
$Limit

Returns

dataset
public
# Award( integer $BadgeID, integer $UserID, integer $InsertUserID = NULL, string $Reason = '' )

Award a badge to a user and record some activity

Award a badge to a user and record some activity

Parameters

$BadgeID
integer
$BadgeID
$UserID
integer
$UserID This is the user that should get the award
$InsertUserID
integer
$InsertUserID This is the user that gave the award
$Reason
string
$Reason This is the reason the giver gave with the award
public integer
# Exists( integer $UserID, integer $BadgeID )

Returns how many badges the user has of this particular id. It should only ever be 1 or zero.

Returns how many badges the user has of this particular id. It should only ever be 1 or zero.

Parameters

$UserID
integer
$UserID
$BadgeID
integer
$BadgeID

Returns

integer
public mixed
# GetByUser( integer $UserID, string $DataType = DATASET_TYPE_ARRAY )

Returns the badges a user has already received

Returns the badges a user has already received

Parameters

$UserID
integer
$UserID
$DataType
string
$DataType

Returns

mixed
public DataSet
# GetUnobtained( integer $UserID )

Returns the list of unobtained but enabled badges for a specific user

Returns the list of unobtained but enabled badges for a specific user

Parameters

$UserID
integer
$UserID

Returns

DataSet
public boolean
# Counts( string $Column, integer $UserID = NULL )

Used by the DBA controller to update the denormalized badge count on the user table via dba/counts

Used by the DBA controller to update the denormalized badge count on the user table via dba/counts

Parameters

$Column
string
$Column
$UserID
integer
$UserID

Returns

boolean

Throws

Gdn_UserException
Yaga API documentation generated by ApiGen 2.8.0