![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/old/vendor/magento/module-security/Model/ResourceModel/ |
<?php /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ namespace Magento\Security\Model\ResourceModel; /** * Password reset request event mysql resource model */ class PasswordResetRequestEvent extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb { /** * @var \Magento\Framework\Stdlib\DateTime */ protected $dateTime; /** * @param \Magento\Framework\Model\ResourceModel\Db\Context $context * @param \Magento\Framework\Stdlib\DateTime $dateTime * @param null $connectionName */ public function __construct( \Magento\Framework\Model\ResourceModel\Db\Context $context, \Magento\Framework\Stdlib\DateTime $dateTime, $connectionName = null ) { parent::__construct($context, $connectionName); $this->dateTime = $dateTime; } /** * Initialize resource model * * @return void */ protected function _construct() { $this->_init('password_reset_request_event', 'id'); } /** * Delete records which has been created earlier than specified timestamp * * @param int $timestamp * @return $this * @throws \Magento\Framework\Exception\LocalizedException */ public function deleteRecordsOlderThen($timestamp) { $this->getConnection()->delete( $this->getMainTable(), ['created_at < ?' => $this->dateTime->formatDate($timestamp)] ); return $this; } }