Просмотр исходного кода

Ticket #258 - Alerts in Market module.

AntonLV 10 лет назад
Родитель
Сommit
4f9255212e
1 измененных файлов с 35 добавлено и 0 удалено
  1. 35 0
      modules/boonex/market/classes/BxMarketCronPruning.php

+ 35 - 0
modules/boonex/market/classes/BxMarketCronPruning.php

@@ -0,0 +1,35 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    Market Market
+ * @ingroup     TridentModules
+ *
+ * @{
+ */
+
+class BxMarketCronPruning extends BxDolCron
+{
+	protected $_sModule;
+	protected $_oModule;
+
+	public function __construct()
+    {
+    	$this->_sModule = 'bx_market';
+    	$this->_oModule = BxDolModule::getInstance($this->_sModule);
+
+        parent::__construct();
+    }
+
+    function processing()
+    {
+        $aLicenses = $this->_oModule->_oDb->getLicense(array('type' => 'expired'));
+        foreach($aLicenses as $aLicense)
+        	bx_alert($this->getName(), 'license_expire', 0, false, $aLicense);
+
+        $this->_oModule->_oDb->processExpiredLicenses();
+    }
+}
+
+/** @} */