source/Application/Controller/Admin/ArticleMain.php
public function addToCategory($sCatID, $sOXID)
    {
        $base = oxNew(\OxidEsales\Eshop\Core\Model\BaseModel::class);
        $base->init("oxobject2category");
        $base->oxobject2category__oxtime = new \OxidEsales\Eshop\Core\Field(0);
        $base->oxobject2category__oxobjectid = new \OxidEsales\Eshop\Core\Field($sOXID);
        $base->oxobject2category__oxcatnid = new \OxidEsales\Eshop\Core\Field($sCatID);

        $base = $this->updateBase($base);

        $base->save();
    }
public function addToCategory($sCatID, $sOXID)
    {
        $base = oxNew(\OxidEsales\Eshop\Core\Model\BaseModel::class);
        $base->init("oxobject2category");
        $base->oxobject2category__oxtime = new \OxidEsales\Eshop\Core\Field(0);
        $base->oxobject2category__oxobjectid = new \OxidEsales\Eshop\Core\Field($sOXID);
        $base->oxobject2category__oxcatnid = new \OxidEsales\Eshop\Core\Field($sCatID);

        $base = $this->updateBase($base);

        $base->save();
    }
public function addToCategory ( $ sCatID , $ sOXID ) { $ base = oxNew ( \ OxidEsales \ Eshop \ Core \ Model \ BaseModel :: class ) ; $ base -> init ( "oxobject2category" ) ; $ base -> oxobject2category__oxtime = new \ OxidEsales \ Eshop \ Core \ Field ( 0 ) ; $ base -> oxobject2category__oxobjectid = new \ OxidEsales \ Eshop \ Core \ Field ( $ sOXID ) ; $ base -> oxobject2category__oxcatnid = new \ OxidEsales \ Eshop \ Core \ Field ( $ sCatID ) ; $ base = $ this -> updateBase ( $ base ) ; $ base -> save ( ) ; }
Add article to category.

@param string $sCatID Category id
@param string $sOXID  Article id
Add article to category .