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; } }