_init(self::TABLE_NAME, self::ID_FIELD_NAME); } /** * Remove old records * * @throws \Magento\Framework\Exception\LocalizedException */ public function deleteOld(): void { $condition = ['date < ?' => date('Y-m-d H:i:s', time() - 86400 * 30)]; $this->getConnection()->delete($this->getMainTable(), $condition); } }