ActivityPoint
extends Facade
in package
Tags
Table of Contents
Methods
- addPoints() : int
- adjustPoints() : int
- convertPointFromPrice() : int
- createTransaction() : PointTransaction
- decreaseUserPointsWithAction() : bool
- getFacadeAccessor() : string
- getMinPointByIds() : int
- getStatisticItems() : array<string|int, mixed>
- getTotalActivityPoints() : int
- getUserPointBalance() : int
- giftPoints() : bool
- installCustomPointSettings() : array<string|int, mixed>
- isAdded() : bool
- isCustomInstalled() : bool
- isPackageAvailableForPurchase() : bool
- isSubtracted() : bool
- proceedPayment() : bool
- updateActivityPoints() : bool
- updateStatistic() : PointStatistic
- updateUserPoints() : int
Methods
addPoints()
public
static 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 = null : int|null
- $extra = [] : array<string|int, mixed>
Return values
intadjustPoints()
public
static adjustPoints(User $context, User $user, int $type, int $amount) : int
;
Parameters
Return values
intconvertPointFromPrice()
public
static convertPointFromPrice(string $currency, float $amount) : int
Parameters
- $currency : string
- $amount : float
Return values
intcreateTransaction()
public
static createTransaction(User $user, Content $content, array<string|int, mixed> $data) : PointTransaction
Parameters
Return values
PointTransactiondecreaseUserPointsWithAction()
public
static 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
boolgetFacadeAccessor()
public
static getFacadeAccessor() : string
Return values
stringgetMinPointByIds()
public
static getMinPointByIds(array<string|int, mixed> $userIds) : int
Parameters
- $userIds : array<string|int, mixed>
Return values
intgetStatisticItems()
public
static getStatisticItems(User $user, PointStatistic $statistic) : array<string|int, mixed>
Parameters
- $user : User
- $statistic : PointStatistic
Return values
array<string|int, mixed>getTotalActivityPoints()
public
static getTotalActivityPoints(User $context) : int
Parameters
- $context : User
Return values
intgetUserPointBalance()
public
static getUserPointBalance(User $context) : int
Parameters
- $context : User
Return values
intgiftPoints()
public
static giftPoints(User $context, User $owner, int $points) : bool
Parameters
Return values
boolinstallCustomPointSettings()
public
static installCustomPointSettings(array<string|int, mixed> $default = []) : array<string|int, mixed>
;
Parameters
- $default = [] : array<string|int, mixed>
Return values
array<string|int, mixed>isAdded()
public
static isAdded(int $type) : bool
Parameters
- $type : int
Return values
boolisCustomInstalled()
public
static isCustomInstalled(string $packageId) : bool
Parameters
- $packageId : string
Return values
boolisPackageAvailableForPurchase()
public
static isPackageAvailableForPurchase(User $user, PointPackage $package) : bool
Parameters
- $user : User
- $package : PointPackage
Return values
boolisSubtracted()
public
static isSubtracted(int $type) : bool
Parameters
- $type : int
Return values
boolproceedPayment()
public
static proceedPayment(Order $order) : bool
;
Parameters
- $order : Order
Return values
boolupdateActivityPoints()
public
static updateActivityPoints(User $context, int $amount, int|null $type = null) : bool
Parameters
- $context : User
- $amount : int
- $type = null : int|null
Return values
boolupdateStatistic()
public
static updateStatistic(User $context, int $type, int $amount) : PointStatistic
Parameters
- $context : User
- $type : int
- $amount : int
Return values
PointStatisticupdateUserPoints()
public
static updateUserPoints(User $user, Entity $content, string $action, int|null $type = null, bool $allowMultiTransactionsPerItem = false) : int
Parameters
- $user : User
- $content : Entity
- $action : string
- $type = null : int|null
- $allowMultiTransactionsPerItem = false : bool