source/Application/Controller/Admin/ActionsArticleAjax.php
public function setActionArticle()
    {
        $sArticleId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('oxarticleid');
        $sActionId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('oxid');
        $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();

        $oDb->Execute(
            'delete from oxobject2action '
            . 'where oxactionid=' . $oDb->quote($sActionId)
            . ' and oxclass = "oxarticle"'
        );

        $oObject2Promotion = oxNew(\OxidEsales\Eshop\Core\Model\BaseModel::class);
        $oObject2Promotion->init('oxobject2action');
        $oObject2Promotion->oxobject2action__oxactionid = new \OxidEsales\Eshop\Core\Field($sActionId);
        $oObject2Promotion->oxobject2action__oxobjectid = new \OxidEsales\Eshop\Core\Field($sArticleId);
        $oObject2Promotion->oxobject2action__oxclass = new \OxidEsales\Eshop\Core\Field("oxarticle");
        $oObject2Promotion->save();
    }
public function setActionArticle()
    {
        $sArticleId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('oxarticleid');
        $sActionId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('oxid');
        $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();

        $oDb->Execute(
            'delete from oxobject2action '
            . 'where oxactionid=' . $oDb->quote($sActionId)
            . ' and oxclass = "oxarticle"'
        );

        $oObject2Promotion = oxNew(\OxidEsales\Eshop\Core\Model\BaseModel::class);
        $oObject2Promotion->init('oxobject2action');
        $oObject2Promotion->oxobject2action__oxactionid = new \OxidEsales\Eshop\Core\Field($sActionId);
        $oObject2Promotion->oxobject2action__oxobjectid = new \OxidEsales\Eshop\Core\Field($sArticleId);
        $oObject2Promotion->oxobject2action__oxclass = new \OxidEsales\Eshop\Core\Field("oxarticle");
        $oObject2Promotion->save();
    }
public function setActionArticle ( ) { $ sArticleId = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( 'oxarticleid' ) ; $ sActionId = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( 'oxid' ) ; $ oDb = \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getDb ( ) ; $ oDb -> Execute ( 'delete from oxobject2action ' . 'where oxactionid=' . $ oDb -> quote ( $ sActionId ) . ' and oxclass = "oxarticle"' ) ; $ oObject2Promotion = oxNew ( \ OxidEsales \ Eshop \ Core \ Model \ BaseModel :: class ) ; $ oObject2Promotion -> init ( 'oxobject2action' ) ; $ oObject2Promotion -> oxobject2action__oxactionid = new \ OxidEsales \ Eshop \ Core \ Field ( $ sActionId ) ; $ oObject2Promotion -> oxobject2action__oxobjectid = new \ OxidEsales \ Eshop \ Core \ Field ( $ sArticleId ) ; $ oObject2Promotion -> oxobject2action__oxclass = new \ OxidEsales \ Eshop \ Core \ Field ( "oxarticle" ) ; $ oObject2Promotion -> save ( ) ; }
Set article assignment
Set article assignment