27 private $requestLogConfig;
39 \
Magento\Framework\Stdlib\DateTime\DateTime $dateTime,
40 RequestLogConfig $requestLogConfig,
45 $this->requestLogConfig = $requestLogConfig;
53 $this->
_init(
'oauth_token_request_log',
'entity_id');
63 ->where(
'user_name = :user_name AND user_type = :user_type');
75 [
'user_name = ?' =>
$userName,
'user_type = ?' => $userType]
84 $date = (new \DateTime())->setTimestamp($this->dateTime->gmtTimestamp());
85 $date->add(
new \DateInterval(
'PT' . $this->requestLogConfig->getLockTimeout() .
'S'));
86 $dateTime = $date->format(\
Magento\Framework\Stdlib\DateTime::DATETIME_PHP_FORMAT);
92 'user_type' => $userType,
93 'failures_count' => 1,
94 'lock_expires_at' => $dateTime
97 'failures_count' =>
new \
Zend_Db_Expr(
'failures_count+1'),
98 'lock_expires_at' =>
new \
Zend_Db_Expr(
"'" . $dateTime .
"'")
108 $date = (new \DateTime())->setTimestamp($this->dateTime->gmtTimestamp());
109 $dateTime = $date->format(\
Magento\Framework\Stdlib\DateTime::DATETIME_PHP_FORMAT);
getFailuresCount($userName, $userType)
_init($mainTable, $idFieldName)
resetFailuresCount($userName, $userType)
incrementFailuresCount($userName, $userType)
__construct(\Magento\Framework\Model\ResourceModel\Db\Context $context, \Magento\Framework\Stdlib\DateTime\DateTime $dateTime, RequestLogConfig $requestLogConfig, $connectionName=null)