\AutoCredit
Automatic user credits setting class
Synopsis
class AutoCredit
{
- // constants
- const OPTION_CFID = 'AUTOCREDIT_CFID';
- // members
- protected array $altCfg = ;
- protected integer $cfId = 0;
- protected array $cfData = ;
- protected array $allUsers = ;
- protected array $allTariffPrices = ;
- protected array $allVservices = ;
- protected array $allUserTags = ;
- protected array $allUserServices = ;
- // methods
- public void __construct()
- protected void loadAter()
- protected void setOptions()
- protected void loadVirtualServices()
- protected void loadTags()
- protected void preprocessVservices()
- protected void loadUsers()
- protected void loadTariffs()
- protected void loadCfs()
- protected string getNextMonth()
- public int processing()
Constants
Name | Value |
---|---|
OPTION_CFID | 'AUTOCREDIT_CFID' |
Members
protected
- $allTariffPrices
—
string
Contains all available tariff prices as name=>Fee - $allUserServices
—
array
Contains preprocessed users virtual services prices as login=>price summary - $allUserTags
—
array
Contains all vservices tags assigned for users as login=>tagIds=>tagCount - $allUsers
—
array
Contains all of available users in database - $allVservices
—
array
Contains available virtual services as tagid=>price - $altCfg
—
array
Contains system alter config as key=>value - $cfData
—
array
Contains array of available CFs of required type for all users as login=>day of month - $cfId
—
int
Custom field ID for mark of required credit setup
Methods
protected
- getNextMonth() — Returns next Year-month number with leading zero in format Y-m-
- loadAter() — Preloads alter config into protected prop for further usage
- loadCfs() — Loads all avaialble CFs content from database for all of existing users
- loadTags() — Loads all tags assigned for users
- loadTariffs() — Loads all available tariff fees
- loadUsers() — Loads all available users from database
- loadVirtualServices() — Loads available virtual services and their prices
- preprocessVservices() — Performs preprocessing of all user virtual services prices into allUserServices prop
- setOptions() — Sets initial options due billing configuration files
public
- __construct() — Creates new automatic creditor instance
- processing() — Performs automatic credit setup