Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
PasswordResetRequestEvent.php
Go to the documentation of this file.
1 <?php
8 
13 {
17  protected $dateTime;
18 
24  public function __construct(
25  \Magento\Framework\Model\ResourceModel\Db\Context $context,
26  \Magento\Framework\Stdlib\DateTime $dateTime,
27  $connectionName = null
28  ) {
29  parent::__construct($context, $connectionName);
30  $this->dateTime = $dateTime;
31  }
32 
38  protected function _construct()
39  {
40  $this->_init('password_reset_request_event', 'id');
41  }
42 
50  public function deleteRecordsOlderThen($timestamp)
51  {
52  $this->getConnection()->delete(
53  $this->getMainTable(),
54  ['created_at < ?' => $this->dateTime->formatDate($timestamp)]
55  );
56 
57  return $this;
58  }
59 }
__construct(\Magento\Framework\Model\ResourceModel\Db\Context $context, \Magento\Framework\Stdlib\DateTime $dateTime, $connectionName=null)