Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Nonce.php
Go to the documentation of this file.
1 <?php
7 
14 {
20  protected function _construct()
21  {
22  $this->_init('oauth_nonce', null);
23  }
24 
31  public function deleteOldEntries($minutes)
32  {
33  if ($minutes > 0) {
34  $connection = $this->getConnection();
35 
36  return $connection->delete(
37  $this->getMainTable(),
38  $connection->quoteInto('timestamp <= ?', time() - $minutes * 60, \Zend_Db::INT_TYPE)
39  );
40  } else {
41  return 0;
42  }
43  }
44 
52  public function selectByCompositeKey($nonce, $consumerId)
53  {
54  $connection = $this->getConnection();
55  $select = $connection->select()->from(
56  $this->getMainTable()
57  )->where(
58  'nonce = ?',
59  $nonce
60  )->where(
61  'consumer_id = ?',
62  $consumerId
63  );
64  $row = $connection->fetchRow($select);
65  return $row ? $row : [];
66  }
67 }
const INT_TYPE
Definition: Db.php:68
$connection
Definition: bulk.php:13