source/Application/Model/SeoEncoderCategory.php
public function markRelatedAsExpired($oCategory)
    {
        $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
        $sIdQuoted = $oDb->quote($oCategory->getId());

        // select it from table instead of using object carrying value
        // this is because this method is usually called inside update,
        // where object may already be carrying changed id
        $aCatInfo = $oDb->getAll("select oxrootid, oxleft, oxright from oxcategories where oxid = $sIdQuoted limit 1");
        $sCatRootIdQuoted = $oDb->quote($aCatInfo[0][0]);

        // update sub cats
        $sQ = "update oxseo as seo1, (select oxid from oxcategories where oxrootid={$sCatRootIdQuoted} and oxleft > " . ((int) $aCatInfo[0][1]) . " and oxright < " . ((int) $aCatInfo[0][2]) . ") as seo2 set seo1.oxexpired = '1' where seo1.oxtype = 'oxcategory' and seo1.oxobjectid = seo2.oxid";
        $oDb->execute($sQ);

        // update subarticles
        $sQ = "update oxseo as seo1, (select o2c.oxobjectid as id from oxcategories as cat left join oxobject2category"
              ." as o2c on o2c.oxcatnid=cat.oxid where cat.oxrootid={$sCatRootIdQuoted} and cat.oxleft >= "
              .((int) $aCatInfo[0][1] )." and cat.oxright <= ".((int) $aCatInfo[0][2] ).") as seo2 "
              ."set seo1.oxexpired = '1' where seo1.oxtype = 'oxarticle' and seo1.oxobjectid = seo2.id "
              ."and seo1.oxfixed = 0";
        $oDb->execute($sQ);
    }
public function markRelatedAsExpired($oCategory)
    {
        $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
        $sIdQuoted = $oDb->quote($oCategory->getId());

        // select it from table instead of using object carrying value
        // this is because this method is usually called inside update,
        // where object may already be carrying changed id
        $aCatInfo = $oDb->getAll("select oxrootid, oxleft, oxright from oxcategories where oxid = $sIdQuoted limit 1");
        $sCatRootIdQuoted = $oDb->quote($aCatInfo[0][0]);

        // update sub cats
        $sQ = "update oxseo as seo1, (select oxid from oxcategories where oxrootid={$sCatRootIdQuoted} and oxleft > " . ((int) $aCatInfo[0][1]) . " and oxright < " . ((int) $aCatInfo[0][2]) . ") as seo2 set seo1.oxexpired = '1' where seo1.oxtype = 'oxcategory' and seo1.oxobjectid = seo2.oxid";
        $oDb->execute($sQ);

        // update subarticles
        $sQ = "update oxseo as seo1, (select o2c.oxobjectid as id from oxcategories as cat left join oxobject2category"
              ." as o2c on o2c.oxcatnid=cat.oxid where cat.oxrootid={$sCatRootIdQuoted} and cat.oxleft >= "
              .((int) $aCatInfo[0][1] )." and cat.oxright <= ".((int) $aCatInfo[0][2] ).") as seo2 "
              ."set seo1.oxexpired = '1' where seo1.oxtype = 'oxarticle' and seo1.oxobjectid = seo2.id "
              ."and seo1.oxfixed = 0";
        $oDb->execute($sQ);
    }
public function markRelatedAsExpired ( $ oCategory ) { $ oDb = \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getDb ( ) ; $ sIdQuoted = $ oDb -> quote ( $ oCategory -> getId ( ) ) ; // select it from table instead of using object carrying value // this is because this method is usually called inside update, // where object may already be carrying changed id $ aCatInfo = $ oDb -> getAll ( "select oxrootid, oxleft, oxright from oxcategories where oxid = $sIdQuoted limit 1" ) ; $ sCatRootIdQuoted = $ oDb -> quote ( $ aCatInfo [ 0 ] [ 0 ] ) ; // update sub cats $ sQ = "update oxseo as seo1, (select oxid from oxcategories where oxrootid={$sCatRootIdQuoted} and oxleft > " . ( ( int ) $ aCatInfo [ 0 ] [ 1 ] ) . " and oxright < " . ( ( int ) $ aCatInfo [ 0 ] [ 2 ] ) . ") as seo2 set seo1.oxexpired = '1' where seo1.oxtype = 'oxcategory' and seo1.oxobjectid = seo2.oxid" ; $ oDb -> execute ( $ sQ ) ; // update subarticles $ sQ = "update oxseo as seo1, (select o2c.oxobjectid as id from oxcategories as cat left join oxobject2category" . " as o2c on o2c.oxcatnid=cat.oxid where cat.oxrootid={$sCatRootIdQuoted} and cat.oxleft >= " . ( ( int ) $ aCatInfo [ 0 ] [ 1 ] ) . " and cat.oxright <= " . ( ( int ) $ aCatInfo [ 0 ] [ 2 ] ) . ") as seo2 " . "set seo1.oxexpired = '1' where seo1.oxtype = 'oxarticle' and seo1.oxobjectid = seo2.id " . "and seo1.oxfixed = 0" ; $ oDb -> execute ( $ sQ ) ; }
Marks related to category objects as expired

@param \OxidEsales\Eshop\Application\Model\Category $oCategory Category object
Marks related to category objects as expired