vB_Library_ReferUser
extends vB_Library
in package
vB_Library_ReferUser
Tags
Table of Contents
- $assertor : object
- $instance : mixed
- __serialize() : mixed
- __sleep() : mixed
- __unserialize() : mixed
- __wakeup() : mixed
- clearCache() : mixed
- deleteExpiredReferralCodes() : mixed
- Deletes old, expired referral codes; used by cron job
- fetchReferrers() : array<string|int, mixed>
- Return a report of referrers
- getContentInstance() : mixed
- getReferralCode() : string
- Generates and returns a user referral code for the currently logged in user
- getUseridFromReferralCode() : bool|int
- Validates a user referral code and returns the associated user id
- instance() : vB_PageCache
- Returns singleton instance of self.
- monitorWords() : mixed
- Checks if the text contains monitored words, and if so, sends notifications to admins and moderators if the setting is on.
- validateReferralCode() : bool|string
- Validates a user referral code
- __construct() : mixed
- Constructor
- getLibraryClassNameInternal() : mixed
- validateReferralCodeInternal() : bool|array<string|int, mixed>
- Validates a user referral code and returns associated information
Properties
$assertor
protected
object
$assertor
=
ull
$instance
protected
static mixed
$instance
= array()
Methods
__serialize()
public
__serialize() : mixed
Return values
mixed —__sleep()
public
__sleep() : mixed
Return values
mixed —__unserialize()
public
__unserialize(mixed $serialized) : mixed
Parameters
- $serialized : mixed
Return values
mixed —__wakeup()
public
__wakeup() : mixed
Return values
mixed —clearCache()
public
static clearCache() : mixed
Return values
mixed —deleteExpiredReferralCodes()
Deletes old, expired referral codes; used by cron job
public
deleteExpiredReferralCodes() : mixed
Return values
mixed —fetchReferrers()
Return a report of referrers
public
fetchReferrers(array<string|int, mixed> $startdate, array<string|int, mixed> $enddate) : array<string|int, mixed>
Parameters
- $startdate : array<string|int, mixed>
-
Start Date of the report. an array of 'year', 'month', 'day', 'hour' and 'minute'
- $enddate : array<string|int, mixed>
-
End Date of the report. an array of 'year', 'month', 'day', 'hour' and 'minute'
Return values
array<string|int, mixed> —Referrers information
getContentInstance()
public
static getContentInstance(mixed $contenttypeid) : mixed
Parameters
- $contenttypeid : mixed
Return values
mixed —getReferralCode()
Generates and returns a user referral code for the currently logged in user
public
getReferralCode() : string
Return values
string —The referral code
getUseridFromReferralCode()
Validates a user referral code and returns the associated user id
public
getUseridFromReferralCode(string $referralCode) : bool|int
Parameters
- $referralCode : string
-
The referral code to validate
Return values
bool|int —Returns the user id associated with the referral code if it is valid and active, false otherwise
instance()
Returns singleton instance of self.
public
static instance(mixed $class) : vB_PageCache
Parameters
- $class : mixed
Return values
vB_PageCache —- Reference to singleton instance of the cache handler
monitorWords()
Checks if the text contains monitored words, and if so, sends notifications to admins and moderators if the setting is on.
public
monitorWords(mixed $text, mixed $type, mixed $nodeid[, mixed $userid = null ][, mixed $insertNotifications = true ], mixed $currentuserid) : mixed
Parameters
- $text : mixed
- $type : mixed
- $nodeid : mixed
- $userid : mixed = null
- $insertNotifications : mixed = true
- $currentuserid : mixed
Return values
mixed —validateReferralCode()
Validates a user referral code
public
validateReferralCode(string $referralCode) : bool|string
Parameters
- $referralCode : string
-
The referral code to validate
Return values
bool|string —Returns the cleaned referral code if it is valid and active, false otherwise
__construct()
Constructor
protected
__construct() : mixed
Return values
mixed —getLibraryClassNameInternal()
protected
static getLibraryClassNameInternal(mixed $controller) : mixed
Parameters
- $controller : mixed
Return values
mixed —validateReferralCodeInternal()
Validates a user referral code and returns associated information
protected
validateReferralCodeInternal(string $referralCode) : bool|array<string|int, mixed>
Parameters
- $referralCode : string
-
The referral code to validate
Return values
bool|array<string|int, mixed> —If the referral code is valid, returns an array with [userid, referralcode], otherwise returns false