36 \
Magento\Framework\Stdlib\DateTime\DateTime $date,
37 $connectionName =
null 51 $this->
_init(
'oauth_token',
'entity_id');
63 if (!$exceptToken->getId() || !$exceptToken->getAuthorized()) {
64 throw new \Magento\Framework\Exception\LocalizedException(
__(
'Invalid token to except'));
68 'authorized = 1 AND consumer_id = ?',
69 $exceptToken->getConsumerId(),
74 if ($exceptToken->getCustomerId()) {
76 }
elseif ($exceptToken->getAdminId()) {
79 throw new \Magento\Framework\Exception\LocalizedException(
__(
'Invalid token to except'));
99 $this->_dateTime->formatDate($this->date->gmtTimestamp() - $minutes * 60)
119 $userTypeCondition =
$connection->quoteInto(
'user_type IN (?)', $userTypes);
122 $this->_dateTime->formatDate($this->date->gmtTimestamp() - $hours * 60 * 60)
126 $userTypeCondition .
' AND ' . $createdAtCondition
145 ->where(
'consumer_id = ?', $consumerId)
146 ->where(
'type = ?',
$type);
162 ->where(
'consumer_id = ?', (
int)$consumerId)
163 ->where(
'user_type = ?', (
int)$userType);
178 ->where(
'admin_id = ?', $adminId)
__construct(\Magento\Framework\Model\ResourceModel\Db\Context $context, \Magento\Framework\Stdlib\DateTime $dateTime, \Magento\Framework\Stdlib\DateTime\DateTime $date, $connectionName=null)
deleteExpiredTokens($hours, $userTypes)
elseif(isset( $params[ 'redirect_parent']))
selectTokenByAdminId($adminId)
selectTokenByCustomerId($customerId)
selectTokenByType($consumerId, $type)
selectTokenByConsumerIdAndUserType($consumerId, $userType)
cleanOldAuthorizedTokensExcept(\Magento\Integration\Model\Oauth\Token $exceptToken)
deleteOldEntries($minutes)