public function setAsDefault()
    {
        $defCat = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("defcat");
        $oxId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("oxid");
        $database = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();

        $quotedOxId = $database->quote($oxId);
        $quotedDefCat = $database->quote($defCat);

        $queryToEmbed = $this->formQueryToEmbedForSettingCategoryAsDefault();

        // #0003650: increment all product references independent to active shop
        $query = "update oxobject2category set oxtime = oxtime + 10 where oxobjectid = {$quotedOxId} {$queryToEmbed}";
        \OxidEsales\Eshop\Core\DatabaseProvider::getInstance()->getDb()->Execute($query);

        // set main category for active shop
        $query = "update oxobject2category set oxtime = 0 where oxobjectid = {$quotedOxId} " .
              "and oxcatnid = {$quotedDefCat} {$queryToEmbed}";
        \OxidEsales\Eshop\Core\DatabaseProvider::getInstance()->getDb()->Execute($query);
        //echo "\n$sQ\n";

        // #0003366: invalidate article SEO for all shops
        \OxidEsales\Eshop\Core\Registry::getSeoEncoder()->markAsExpired($oxId, null, 1, null, "oxtype='oxarticle'");
        $this->resetContentCache();
    }