MetaFox

ActivityPoint
in package
implements ActivityPoint

Tags
SuppressWarnings

(PHPMD.CouplingBetweenObjects)

Table of Contents

Interfaces

ActivityPoint

Constants

ADDED_COLOR  = '#31a24a'
ALLOW_TYPES  = ['activitypoint::phrase.type_all' => self::TYPE_ALL, 'activitypoint::phrase.type_earned' => self::TYPE_EARNED, 'activitypoint::phrase.type_bought' => self::TYPE_BOUGHT, 'activitypoint::phrase.type_sent' => self::TYPE_SENT, 'activitypoint::phrase.type_spent' => self::TYPE_SPENT, 'activitypoint::phrase.type_received' => self::TYPE_RECEIVED, 'activitypoint::phrase.type_retrieved' => self::TYPE_RETRIEVED]
SUBTRACTED_COLOR  = '#f02848'
TOTAL_POINT_VALUE_NAME  = 'total_activity_points'
TYPE_ALL  = 0
TYPE_BOUGHT  = 2
TYPE_EARNED  = 1
TYPE_RECEIVED  = 5
TYPE_RETRIEVED  = 6
TYPE_SENT  = 3
TYPE_SPENT  = 4

Properties

$settingRepository  : PointSettingRepositoryInterface
$statisticRepository  : PointStatisticRepositoryInterface
$transactionRepository  : PointTransactionRepositoryInterface

Methods

__construct()  : mixed
addPoints()  : int
adjustPoints()  : int|null
convertPointFromPrice()  : int
createTransaction()  : PointTransaction
decreaseUserPointsWithAction()  : bool
getConversionRate()  : float
getMinPointByIds()  : int
getSettingActionsByPackageId()  : array<int, mixed>
getTotalActivityPoints()  : int
getUserPointBalance()  : int
giftPoints()  : bool
installCustomPointSettings()  : void
isAdded()  : bool
isCustomInstalled()  : bool
isPackageAvailableForPurchase()  : bool
isSubtracted()  : bool
proceedPayment()  : bool
updateActivityPoints()  : bool
updateStatistic()  : PointStatistic
updateUserPoints()  : int
addPointForOwnerItem()  : void
checkAdminCanSendPoint()  : bool
getSentPoint()  : int
getTimeByPeriod()  : string

Constants

ALLOW_TYPES

public mixed ALLOW_TYPES = ['activitypoint::phrase.type_all' => self::TYPE_ALL, 'activitypoint::phrase.type_earned' => self::TYPE_EARNED, 'activitypoint::phrase.type_bought' => self::TYPE_BOUGHT, 'activitypoint::phrase.type_sent' => self::TYPE_SENT, 'activitypoint::phrase.type_spent' => self::TYPE_SPENT, 'activitypoint::phrase.type_received' => self::TYPE_RECEIVED, 'activitypoint::phrase.type_retrieved' => self::TYPE_RETRIEVED]

TOTAL_POINT_VALUE_NAME

public mixed TOTAL_POINT_VALUE_NAME = 'total_activity_points'

Properties

Methods

addPoints()

public addPoints(User $context, User $owner, int $amount[, int|null $type = null ][, array<string|int, mixed> $extra = [] ]) : int
Parameters
$context : User
$owner : User
$amount : int
$type : int|null = null
$extra : array<string|int, mixed> = []
Tags
inheritDoc
Return values
int

adjustPoints()

public adjustPoints(User $context, User $user, int $type, int $amount) : int|null
Parameters
$context : User
$user : User
$type : int
$amount : int
Tags
inheritDoc
Return values
int|null

convertPointFromPrice()

public convertPointFromPrice(string $currency, float $amount) : int
Parameters
$currency : string
$amount : float
Tags
inheritDoc
Return values
int

decreaseUserPointsWithAction()

public decreaseUserPointsWithAction(User $user, int $points, string $action, string $actionTypeName[, array<string|int, mixed> $actionParams = [] ]) : bool
Parameters
$user : User
$points : int
$action : string
$actionTypeName : string
$actionParams : array<string|int, mixed> = []
Return values
bool

getConversionRate()

public getConversionRate(string $currency) : float
Parameters
$currency : string
Tags
inheritDoc
Return values
float

getMinPointByIds()

public getMinPointByIds(array<string|int, mixed> $userIds) : int
Parameters
$userIds : array<string|int, mixed>
Return values
int

getSettingActionsByPackageId()

public getSettingActionsByPackageId(string $packageId) : array<int, mixed>
Parameters
$packageId : string
Tags
params

string $packageId

Return values
array<int, mixed>

getTotalActivityPoints()

public getTotalActivityPoints(User $context) : int
Parameters
$context : User
Tags
inheritDoc
Return values
int

getUserPointBalance()

public getUserPointBalance(User $context) : int
Parameters
$context : User
Return values
int

giftPoints()

public giftPoints(User $context, User $owner, int $points) : bool
Parameters
$context : User
$owner : User
$points : int
Tags
throws
AuthorizationException
Return values
bool

installCustomPointSettings()

public installCustomPointSettings([array<string|int, mixed> $default = [] ]) : void
Parameters
$default : array<string|int, mixed> = []
Tags
inheritDoc

isAdded()

public isAdded(int $type) : bool
Parameters
$type : int
Return values
bool

isCustomInstalled()

public isCustomInstalled(string $packageId) : bool
Parameters
$packageId : string
Tags
inheritDoc
Return values
bool

isSubtracted()

public isSubtracted(int $type) : bool
Parameters
$type : int
Return values
bool

proceedPayment()

public proceedPayment(Order $order) : bool
Parameters
$order : Order
Tags
inheritDoc
Return values
bool

updateActivityPoints()

public updateActivityPoints(User $context, int $amount) : bool
Parameters
$context : User
$amount : int
Tags
inheritDoc
Return values
bool

updateUserPoints()

public updateUserPoints(User $user, Entity $content, string $action, int $type[, bool $allowMultiTransactionsPerItem = false ]) : int
Parameters
$user : User
$content : Entity
$action : string
$type : int
$allowMultiTransactionsPerItem : bool = false
Tags
inheritDoc
Return values
int

addPointForOwnerItem()

protected addPointForOwnerItem(User $user, User $owner, string $packageId, int $amount) : void
Parameters
$user : User
$owner : User
$packageId : string
$amount : int

checkAdminCanSendPoint()

private checkAdminCanSendPoint(User $context, User $user, int $type, int $amount) : bool
Parameters
$context : User
$user : User
$type : int
$amount : int
Return values
bool

getSentPoint()

private getSentPoint(int $period) : int
Parameters
$period : int
Return values
int

getTimeByPeriod()

private getTimeByPeriod(int $period) : string
Parameters
$period : int
Return values
string

        
On this page

Search results