trait AccountCommon

Account limits common between total and timed

Most of the extra complexity with accounts comes from the fact that accounts can inherit properties from groups. Also, functions are provided that load both an account's limits and the limits of all groups that apply to it.

Account limit objects are automatically created if a group that the account is part of has a limit object.

Traits

Trait that overrides some BaseObject functions to allow inheriting properties from Groups

Methods

GetScalar(string $field, bool $allowTemp = true)

No description

TryGetScalar(string $field, bool $allowTemp = true)

No description

GetObject(string $field)

No description

BaseObject|null
TryGetObject(string $field)

No description

BaseObject|null
TryGetInheritsScalarFrom(string $field)

No description

BaseObject|null
TryGetInheritsObjectFrom(string $field)

Returns the object that the value of the given field is inherited from

TryGetInheritable(string $field, bool $useobj = false)

Returns an inherited property value and source pair

static string
GetObjectClass()

No description

string
GetAccountID()

Returns the ID of the limited account

GetAccount()

Returns the limited account

array
GetClientObject(bool $isadmin = false)

Returns a printable client object that includes property inherit sources

static string
GetBaseUsage()

No description

void
SetBaseLimits(Input $input)

No description

static AccountCommon
ConfigLimits(ObjectDatabase $database, Account $account, Input $input)

Configures limits for the given account with the given input

void
BaseProcessGroupRemove(Base $grlim)

Processes a group membership removal, possibly deleting this account limit

Details

in GroupInherit at line 817
protected GetScalar(string $field, bool $allowTemp = true)

No description

Parameters

string $field
bool $allowTemp

in GroupInherit at line 825
protected TryGetScalar(string $field, bool $allowTemp = true)

No description

Parameters

string $field
bool $allowTemp

in GroupInherit at line 832
protected BaseObject GetObject(string $field)

No description

Parameters

string $field

Return Value

BaseObject

in GroupInherit at line 840
protected BaseObject|null TryGetObject(string $field)

No description

Parameters

string $field

Return Value

BaseObject|null

at line 45
protected BaseObject|null TryGetInheritsScalarFrom(string $field)

No description

Parameters

string $field

Return Value

BaseObject|null

in GroupInherit at line 854
protected BaseObject|null TryGetInheritsObjectFrom(string $field)

Returns the object that the value of the given field is inherited from

Parameters

string $field

Return Value

BaseObject|null

in GroupInherit at line 868
protected InheritedProperty TryGetInheritable(string $field, bool $useobj = false)

Returns an inherited property value and source pair

Values can be inherited from this account, from any group it is a member of, or if using a default value, null

Parameters

string $field

the inherited property to find

bool $useobj

true if this is an object reference, not a scalar

Return Value

InheritedProperty

value/source pair

at line 36
static protected string GetObjectClass()

No description

Return Value

string

at line 39
protected string GetAccountID()

Returns the ID of the limited account

Return Value

string

at line 42
protected Account GetAccount()

Returns the limited account

Return Value

Account

at line 61
array GetClientObject(bool $isadmin = false)

Returns a printable client object that includes property inherit sources

Parameters

bool $isadmin

if true, show property inherit sources

Return Value

array

{features:{track_items:bool,track_dlstats:bool}, features_from:"id:class", limits_from:"id:class"}

See also

Total::GetClientObject
Timed::GetClientObject

at line 82
static string GetBaseUsage()

No description

Return Value

string

at line 84
protected void SetBaseLimits(Input $input)

No description

Parameters

Input $input

Return Value

void

at line 104
static AccountCommon ConfigLimits(ObjectDatabase $database, Account $account, Input $input)

Configures limits for the given account with the given input

Parameters

ObjectDatabase $database
Account $account
Input $input

Return Value

AccountCommon

at line 116
protected void BaseProcessGroupRemove(Base $grlim)

Processes a group membership removal, possibly deleting this account limit

The account limit will be deleted if it does not have any properties that were set specifically for it, and no other group limits applicable to it exist

Parameters

Base $grlim

group to remove

Return Value

void