* @link http://www.oxidmodule.com */ namespace D3\TaxRatesAdjustment\Models; use oxConfig; use oxRegistry; abstract class genericAbstract { public $rateChanges = [ 19 => 16, 7 => 5 ]; /** * @return bool */ public function isInExecutableTimeRange() { // skip time check, when parameter -d is set $opts = getopt("d"); if (is_array($opts) && isset($opts['d'])) { return true; } list($from, $to) = $this->execPeriod; return (time() > strtotime($from)) && (time() < strtotime($to)); } /** * @param int $id * * @throws \oxConnectionException */ public function switchToShop($id) { if (oxRegistry::getConfig()->isMall() && $id != oxRegistry::getConfig()->getActiveShop()->getId() ) { /** @var oxConfig $oNewConf */ $oNewConf = new oxConfig(); $oNewConf->setShopId($id); $oNewConf->init(); oxRegistry::getConfig()->onShopChange(); oxRegistry::getSession()->setVariable('actshop', $id); oxRegistry::getSession()->setVariable('currentadminshop', $id); oxRegistry::getConfig()->setShopId($id); } } }