source/Application/Model/Shop.php
protected function _cleanInvalidViews()
    {
        $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
        $oLang = \OxidEsales\Eshop\Core\Registry::getLang();
        $aLanguages = $oLang->getLanguageIds($this->getId());

        $aMultilangTables = \OxidEsales\Eshop\Core\Registry::getLang()->getMultiLangTables();
        $aMultishopTables = $this->getMultiShopTables();

        $oLang = \OxidEsales\Eshop\Core\Registry::getLang();
        $aAllShopLanguages = $oLang->getAllShopLanguageIds();

        $oViewsValidator = oxNew(\OxidEsales\Eshop\Application\Model\ShopViewValidator::class);

        $oViewsValidator->setShopId($this->getId());
        $oViewsValidator->setLanguages($aLanguages);
        $oViewsValidator->setAllShopLanguages($aAllShopLanguages);
        $oViewsValidator->setMultiLangTables($aMultilangTables);
        $oViewsValidator->setMultiShopTables($aMultishopTables);

        $aViews = $oViewsValidator->getInvalidViews();

        foreach ($aViews as $sView) {
            $oDb->execute('DROP VIEW IF EXISTS `' . $sView . '`');
        }
    }
protected function _cleanInvalidViews()
    {
        $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
        $oLang = \OxidEsales\Eshop\Core\Registry::getLang();
        $aLanguages = $oLang->getLanguageIds($this->getId());

        $aMultilangTables = \OxidEsales\Eshop\Core\Registry::getLang()->getMultiLangTables();
        $aMultishopTables = $this->getMultiShopTables();

        $oLang = \OxidEsales\Eshop\Core\Registry::getLang();
        $aAllShopLanguages = $oLang->getAllShopLanguageIds();

        $oViewsValidator = oxNew(\OxidEsales\Eshop\Application\Model\ShopViewValidator::class);

        $oViewsValidator->setShopId($this->getId());
        $oViewsValidator->setLanguages($aLanguages);
        $oViewsValidator->setAllShopLanguages($aAllShopLanguages);
        $oViewsValidator->setMultiLangTables($aMultilangTables);
        $oViewsValidator->setMultiShopTables($aMultishopTables);

        $aViews = $oViewsValidator->getInvalidViews();

        foreach ($aViews as $sView) {
            $oDb->execute('DROP VIEW IF EXISTS `' . $sView . '`');
        }
    }
protected function _cleanInvalidViews ( ) { $ oDb = \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getDb ( ) ; $ oLang = \ OxidEsales \ Eshop \ Core \ Registry :: getLang ( ) ; $ aLanguages = $ oLang -> getLanguageIds ( $ this -> getId ( ) ) ; $ aMultilangTables = \ OxidEsales \ Eshop \ Core \ Registry :: getLang ( ) -> getMultiLangTables ( ) ; $ aMultishopTables = $ this -> getMultiShopTables ( ) ; $ oLang = \ OxidEsales \ Eshop \ Core \ Registry :: getLang ( ) ; $ aAllShopLanguages = $ oLang -> getAllShopLanguageIds ( ) ; $ oViewsValidator = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ ShopViewValidator :: class ) ; $ oViewsValidator -> setShopId ( $ this -> getId ( ) ) ; $ oViewsValidator -> setLanguages ( $ aLanguages ) ; $ oViewsValidator -> setAllShopLanguages ( $ aAllShopLanguages ) ; $ oViewsValidator -> setMultiLangTables ( $ aMultilangTables ) ; $ oViewsValidator -> setMultiShopTables ( $ aMultishopTables ) ; $ aViews = $ oViewsValidator -> getInvalidViews ( ) ; foreach ( $ aViews as $ sView ) { $ oDb -> execute ( 'DROP VIEW IF EXISTS `' . $ sView . '`' ) ; } }
Gets all invalid views and drops them from database
Gets all invalid views and drops them from database