Jelajahi Sumber

#2876 Cleanup notification data

RomanL 6 tahun lalu
induk
melakukan
7bda4782cc
1 mengubah file dengan 34 tambahan dan 0 penghapusan
  1. 34 0
      modules/boonex/notifications/classes/BxNtfsCronClean.php

+ 34 - 0
modules/boonex/notifications/classes/BxNtfsCronClean.php

@@ -0,0 +1,34 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Notifications Notifications
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxNtfsCronClean extends BxDolCron
+{
+    protected $_sModule;
+    protected $_oModule;
+
+    public function __construct()
+    {
+    	$this->_sModule = 'bx_notifications';
+    	$this->_oModule = BxDolModule::getInstance($this->_sModule);
+
+        parent::__construct();
+    }
+
+    function processing()
+    {
+        $iClearIntervalInDays = (int)getParam('bx_notifications_clear_interval');
+        if($iClearIntervalInDays > 0){
+            $this->_oModule->_oDb->cleanEvents($iClearIntervalInDays);
+        }
+    }
+}
+
+/** @} */