getUserThrottle() публичный статический Метод

Get the user throttle information If not found, makes a new one
public static getUserThrottle ( integer $userId ) : Psecio\Gatekeeper\ThrottleModel
$userId integer User ID
Результат Psecio\Gatekeeper\ThrottleModel instance
Пример #1
0
 /**
  * Execute the evaluation for the restriction
  *
  * @return boolean Success/fail of evaluation
  */
 public function evaluate()
 {
     $config = $this->getConfig();
     $throttle = \Psecio\Gatekeeper\Gatekeeper::getUserThrottle($config['userId']);
     $throttle->updateAttempts();
     $this->model = $throttle;
     // See if they're blocked
     if ($throttle->status === \Psecio\Gatekeeper\ThrottleModel::STATUS_BLOCKED) {
         $result = $throttle->checkTimeout();
         if ($result === false) {
             return false;
         }
     } else {
         $result = $throttle->checkAttempts();
         if ($result === false) {
             return false;
         }
     }
     return true;
 }