DayContext extends BaseContext
FinalYes
Table of Contents
Methods
- addCounter() : void
- Add value to counter. If counter not exists set counter to value.
- addCurrencyCounter() : void
- Add currency value to counter. If counter not exists set counter to value.
- addDayCounter() : void
- Add value to counter (once a day per person). If counter not exists set counter to value.
- attachEntityItem() : void
- Attach entity item to context.
- getEntityItemInstance() : self
- Get context of attached entity item.
- getInstance() : self
- Get day context singleton instance.
- getSiteInstance() : self
- Returns context for given Site
- subCurrencyCounter() : void
- Subtraction currency value from counter
- subDayCounter() : void
- Subtraction value from counter. If counter not exists does anything.
Methods
addCounter()
Add value to counter. If counter not exists set counter to value.
public
addCounter(Date $day, string $name[, int|float $value = null ]) : void
Parameters
- $day : Date
-
Counter date.
- $name : string
-
Counter name.
- $value : int|float = null
-
Number to add.
addCurrencyCounter()
Add currency value to counter. If counter not exists set counter to value.
public
addCurrencyCounter(string $name, int|float|string $value, string $currency) : void
Parameters
- $name : string
-
Counter name.
- $value : int|float|string
-
Numeric value.
- $currency : string
-
Currency code (eg: RUB).
addDayCounter()
Add value to counter (once a day per person). If counter not exists set counter to value.
public
addDayCounter(string $name, int|float $value) : void
Parameters
- $name : string
-
Counter name.
- $value : int|float
-
Number to add.
attachEntityItem()
Attach entity item to context.
public
attachEntityItem(string $entity, string|int $item) : void
Parameters
- $entity : string
-
Entity type.
- $item : string|int
-
Entity item ID.
Tags
getEntityItemInstance()
Get context of attached entity item.
public
static getEntityItemInstance(string $entity, string|int $item) : self
Parameters
- $entity : string
-
Entity type.
- $item : string|int
-
Entity item ID.
Return values
selfgetInstance()
Get day context singleton instance.
public
static getInstance() : self
Return values
selfgetSiteInstance()
Returns context for given Site
public
static getSiteInstance(string $siteId) : self
Parameters
- $siteId : string
-
Site ID.
Return values
selfsubCurrencyCounter()
Subtraction currency value from counter
public
subCurrencyCounter(Date $day, string $name, int|float $value, string $currency) : void
Parameters
- $day : Date
- $name : string
- $value : int|float
- $currency : string
subDayCounter()
Subtraction value from counter. If counter not exists does anything.
public
subDayCounter(Date $day, string $name, int|float $value) : void
Parameters
- $day : Date
- $name : string
- $value : int|float