src/models/BaseUser.php
public function saveAllowance($request, $action, $allowance, $timestamp)
    {
        Yii::$app->cache->set($action->controller->id . ':' . $action->id . ':' . $this->id . '_allowance', $allowance, 60);
        Yii::$app->cache->set($action->controller->id . ':' . $action->id . ':' . $this->id . '_allowance_update_at', $timestamp, 60);
    }
public function saveAllowance($request, $action, $allowance, $timestamp)
    {
        Yii::$app->cache->set($action->controller->id . ':' . $action->id . ':' . $this->id . '_allowance', $allowance, 60);
        Yii::$app->cache->set($action->controller->id . ':' . $action->id . ':' . $this->id . '_allowance_update_at', $timestamp, 60);
    }
public function saveAllowance ( $ request , $ action , $ allowance , $ timestamp ) { Yii :: $ app -> cache -> set ( $ action -> controller -> id . ':' . $ action -> id . ':' . $ this -> id . '_allowance' , $ allowance , 60 ) ; Yii :: $ app -> cache -> set ( $ action -> controller -> id . ':' . $ action -> id . ':' . $ this -> id . '_allowance_update_at' , $ timestamp , 60 ) ; }
Saves the number of allowed requests and the corresponding timestamp to a persistent storage.
@param \yii\web\Request $request the current request
@param \yii\base\Action $action the action to be executed
@param int $allowance the number of allowed requests remaining.
@param int $timestamp the current timestamp.
Saves the number of allowed requests and the corresponding timestamp to a persistent storage .