source/Application/Controller/Admin/ArticleMain.php
protected function _copyCategories($sOldId, $newArticleId)
    {
        $myUtilsObject = \OxidEsales\Eshop\Core\Registry::getUtilsObject();
        $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();

        $sO2CView = getViewName('oxobject2category');
        $sQ = "select oxcatnid, oxtime from {$sO2CView} where oxobjectid = " . $oDb->quote($sOldId);
        $oRs = $oDb->select($sQ);
        if ($oRs !== false && $oRs->count() > 0) {
            while (!$oRs->EOF) {
                $uniqueId = $myUtilsObject->generateUid();
                $sCatId = $oRs->fields[0];
                $sTime = $oRs->fields[1];
                $sSql = $this->formQueryForCopyingToCategory($newArticleId, $uniqueId, $sCatId, $sTime);
                $oDb->execute($sSql);
                $oRs->fetchRow();
            }
        }
    }
protected function _copyCategories($sOldId, $newArticleId)
    {
        $myUtilsObject = \OxidEsales\Eshop\Core\Registry::getUtilsObject();
        $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();

        $sO2CView = getViewName('oxobject2category');
        $sQ = "select oxcatnid, oxtime from {$sO2CView} where oxobjectid = " . $oDb->quote($sOldId);
        $oRs = $oDb->select($sQ);
        if ($oRs !== false && $oRs->count() > 0) {
            while (!$oRs->EOF) {
                $uniqueId = $myUtilsObject->generateUid();
                $sCatId = $oRs->fields[0];
                $sTime = $oRs->fields[1];
                $sSql = $this->formQueryForCopyingToCategory($newArticleId, $uniqueId, $sCatId, $sTime);
                $oDb->execute($sSql);
                $oRs->fetchRow();
            }
        }
    }
protected function _copyCategories ( $ sOldId , $ newArticleId ) { $ myUtilsObject = \ OxidEsales \ Eshop \ Core \ Registry :: getUtilsObject ( ) ; $ oDb = \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getDb ( ) ; $ sO2CView = getViewName ( 'oxobject2category' ) ; $ sQ = "select oxcatnid, oxtime from {$sO2CView} where oxobjectid = " . $ oDb -> quote ( $ sOldId ) ; $ oRs = $ oDb -> select ( $ sQ ) ; if ( $ oRs !== false && $ oRs -> count ( ) > 0 ) { while ( ! $ oRs -> EOF ) { $ uniqueId = $ myUtilsObject -> generateUid ( ) ; $ sCatId = $ oRs -> fields [ 0 ] ; $ sTime = $ oRs -> fields [ 1 ] ; $ sSql = $ this -> formQueryForCopyingToCategory ( $ newArticleId , $ uniqueId , $ sCatId , $ sTime ) ; $ oDb -> execute ( $ sSql ) ; $ oRs -> fetchRow ( ) ; } } }
Copying category assignments

@param string $sOldId       Id from old article
@param string $newArticleId Id from new article
Copying category assignments