Decrement
CUserCounter::Decrement( user_id, code, site_id = SITE_ID, sendPull = true, decrement = 1 )
The method decrements counter for required value. Static method.
Parameters
Parameter | Description | Available from version |
---|---|---|
user_id | Parameter description | |
code | Optional parameter description | |
site_id | Optional. Equals to SITE_ID by default. | |
sendPull | Optional. Specifies to immediately send data into the Push&Pull module for "real time counters" (sending is available when module is installed and "Queue server" is activated. Without queue server, the method works from the Push&Pull module version 12.5.4) If this counter must not be thrown, specify false. True by default. | 12.5.8 |
increment | Decrement value for the counter. | 14.0.0 |
Returned value
Returns true on success and false otherwise.
Example
CUserCounter::Decrement($USER->GetID(), 'code1');
© «Bitrix24», 2001-2024