source/Application/Model/Actions.php
public function addArticle($articleId)
    {
        $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
        $sQ = "select max(oxsort) from oxactions2article where oxactionid = " . $oDb->quote($this->getId()) . " and oxshopid = '" . $this->getShopId() . "'";
        $iSort = ((int) $oDb->getOne($sQ)) + 1;

        $oNewGroup = oxNew(\OxidEsales\Eshop\Core\Model\BaseModel::class);
        $oNewGroup->init('oxactions2article');
        $oNewGroup->oxactions2article__oxshopid = new \OxidEsales\Eshop\Core\Field($this->getShopId());
        $oNewGroup->oxactions2article__oxactionid = new \OxidEsales\Eshop\Core\Field($this->getId());
        $oNewGroup->oxactions2article__oxartid = new \OxidEsales\Eshop\Core\Field($articleId);
        $oNewGroup->oxactions2article__oxsort = new \OxidEsales\Eshop\Core\Field($iSort);
        $oNewGroup->save();
    }
public function addArticle($articleId)
    {
        $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
        $sQ = "select max(oxsort) from oxactions2article where oxactionid = " . $oDb->quote($this->getId()) . " and oxshopid = '" . $this->getShopId() . "'";
        $iSort = ((int) $oDb->getOne($sQ)) + 1;

        $oNewGroup = oxNew(\OxidEsales\Eshop\Core\Model\BaseModel::class);
        $oNewGroup->init('oxactions2article');
        $oNewGroup->oxactions2article__oxshopid = new \OxidEsales\Eshop\Core\Field($this->getShopId());
        $oNewGroup->oxactions2article__oxactionid = new \OxidEsales\Eshop\Core\Field($this->getId());
        $oNewGroup->oxactions2article__oxartid = new \OxidEsales\Eshop\Core\Field($articleId);
        $oNewGroup->oxactions2article__oxsort = new \OxidEsales\Eshop\Core\Field($iSort);
        $oNewGroup->save();
    }
public function addArticle ( $ articleId ) { $ oDb = \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getDb ( ) ; $ sQ = "select max(oxsort) from oxactions2article where oxactionid = " . $ oDb -> quote ( $ this -> getId ( ) ) . " and oxshopid = '" . $ this -> getShopId ( ) . "'" ; $ iSort = ( ( int ) $ oDb -> getOne ( $ sQ ) ) + 1 ; $ oNewGroup = oxNew ( \ OxidEsales \ Eshop \ Core \ Model \ BaseModel :: class ) ; $ oNewGroup -> init ( 'oxactions2article' ) ; $ oNewGroup -> oxactions2article__oxshopid = new \ OxidEsales \ Eshop \ Core \ Field ( $ this -> getShopId ( ) ) ; $ oNewGroup -> oxactions2article__oxactionid = new \ OxidEsales \ Eshop \ Core \ Field ( $ this -> getId ( ) ) ; $ oNewGroup -> oxactions2article__oxartid = new \ OxidEsales \ Eshop \ Core \ Field ( $ articleId ) ; $ oNewGroup -> oxactions2article__oxsort = new \ OxidEsales \ Eshop \ Core \ Field ( $ iSort ) ; $ oNewGroup -> save ( ) ; }
Adds an article to this actions

@param string $articleId id of the article to be added
Adds an article to this actions