* @link http://www.oxidmodule.com */ namespace D3\Unzer\Setup; use D3\ModCfg\Application\Model\Install\d3install_updatebase; use D3\ModCfg\Application\Model\Installwizzard\d3installdbcommon; use OxidEsales\Eshop\Core\Database\Adapter\DatabaseInterface; use OxidEsales\Eshop\Core\DatabaseProvider; use OxidEsales\Eshop\Core\Exception\DatabaseConnectionException; use OxidEsales\Eshop\Core\Exception\DatabaseErrorException; use OxidEsales\Eshop\Core\Exception\SystemComponentException; use OxidEsales\Eshop\Core\Registry; use OxidEsales\Facts\Facts; class CleanupRoutine extends d3install_updatebase { protected $_aUpdateMethods = [ [ 'check' => 'hasStoredDataWithWrongShopid', 'do' => 'cleanUpStoredDataShopids' ], ]; /** * @throws DatabaseConnectionException * @throws DatabaseErrorException * @throws SystemComponentException */ public function cleanUpStoredDataShopids() { if ($this->hasStoredDataWithWrongShopid()) { $query = <<setActionLog('SQL', $query); if ($this->hasExecute()) { /** @var d3installdbcommon $oDbCommon */ $oDbCommon = oxNew(d3installdbcommon::class, $this); return $oDbCommon->sqlExecute($query); } } return true; } /** * @return bool|DatabaseInterface * @throws DatabaseConnectionException */ public function hasStoredDataWithWrongShopid(): bool { if (false === Registry::get(Facts::class)->isEnterprise()) { return false; } // has d3hpuid Entires with wrong shopid ? $query = <<getOne($query); } }