source/Application/Controller/Admin/DiscountArticlesAjax.php
protected function addArticleToDiscount($discountListId, $articleId)
    {
        $object2Discount = oxNew(\OxidEsales\Eshop\Core\Model\BaseModel::class);
        $object2Discount->init('oxobject2discount');
        $object2Discount->oxobject2discount__oxdiscountid = new \OxidEsales\Eshop\Core\Field($discountListId);
        $object2Discount->oxobject2discount__oxobjectid = new \OxidEsales\Eshop\Core\Field($articleId);
        $object2Discount->oxobject2discount__oxtype = new \OxidEsales\Eshop\Core\Field("oxarticles");

        $object2Discount->save();
    }
protected function addArticleToDiscount($discountListId, $articleId)
    {
        $object2Discount = oxNew(\OxidEsales\Eshop\Core\Model\BaseModel::class);
        $object2Discount->init('oxobject2discount');
        $object2Discount->oxobject2discount__oxdiscountid = new \OxidEsales\Eshop\Core\Field($discountListId);
        $object2Discount->oxobject2discount__oxobjectid = new \OxidEsales\Eshop\Core\Field($articleId);
        $object2Discount->oxobject2discount__oxtype = new \OxidEsales\Eshop\Core\Field("oxarticles");

        $object2Discount->save();
    }
protected function addArticleToDiscount ( $ discountListId , $ articleId ) { $ object2Discount = oxNew ( \ OxidEsales \ Eshop \ Core \ Model \ BaseModel :: class ) ; $ object2Discount -> init ( 'oxobject2discount' ) ; $ object2Discount -> oxobject2discount__oxdiscountid = new \ OxidEsales \ Eshop \ Core \ Field ( $ discountListId ) ; $ object2Discount -> oxobject2discount__oxobjectid = new \ OxidEsales \ Eshop \ Core \ Field ( $ articleId ) ; $ object2Discount -> oxobject2discount__oxtype = new \ OxidEsales \ Eshop \ Core \ Field ( "oxarticles" ) ; $ object2Discount -> save ( ) ; }
Adds article to discount list

@param string $discountListId
@param string $articleId
Adds article to discount list