source/Application/Model/RecommendationList.php
public function addArticle($sOXID, $sDesc)
    {
        $blAdd = false;
        if ($sOXID) {
            // We force reading from master to prevent issues with slow replications or open transactions (see ESDEV-3804 and ESDEV-3822).
            $database = \OxidEsales\Eshop\Core\DatabaseProvider::getMaster(\OxidEsales\Eshop\Core\DatabaseProvider::FETCH_MODE_ASSOC);

            if (!$database->getOne("select oxid from oxobject2list where oxobjectid=" . $database->quote($sOXID) . " and oxlistid=" . $database->quote($this->getId()))) {
                $sUid = \OxidEsales\Eshop\Core\Registry::getUtilsObject()->generateUID();
                $sQ = "insert into oxobject2list ( oxid, oxobjectid, oxlistid, oxdesc ) values ( '$sUid', " . $database->quote($sOXID) . ", " . $database->quote($this->getId()) . ", " . $database->quote($sDesc) . " )";
                $blAdd = $database->execute($sQ);
            }
        }

        return $blAdd;
    }
public function addArticle($sOXID, $sDesc)
    {
        $blAdd = false;
        if ($sOXID) {
            // We force reading from master to prevent issues with slow replications or open transactions (see ESDEV-3804 and ESDEV-3822).
            $database = \OxidEsales\Eshop\Core\DatabaseProvider::getMaster(\OxidEsales\Eshop\Core\DatabaseProvider::FETCH_MODE_ASSOC);

            if (!$database->getOne("select oxid from oxobject2list where oxobjectid=" . $database->quote($sOXID) . " and oxlistid=" . $database->quote($this->getId()))) {
                $sUid = \OxidEsales\Eshop\Core\Registry::getUtilsObject()->generateUID();
                $sQ = "insert into oxobject2list ( oxid, oxobjectid, oxlistid, oxdesc ) values ( '$sUid', " . $database->quote($sOXID) . ", " . $database->quote($this->getId()) . ", " . $database->quote($sDesc) . " )";
                $blAdd = $database->execute($sQ);
            }
        }

        return $blAdd;
    }
public function addArticle ( $ sOXID , $ sDesc ) { $ blAdd = false ; if ( $ sOXID ) { // We force reading from master to prevent issues with slow replications or open transactions (see ESDEV-3804 and ESDEV-3822). $ database = \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getMaster ( \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: FETCH_MODE_ASSOC ) ; if ( ! $ database -> getOne ( "select oxid from oxobject2list where oxobjectid=" . $ database -> quote ( $ sOXID ) . " and oxlistid=" . $ database -> quote ( $ this -> getId ( ) ) ) ) { $ sUid = \ OxidEsales \ Eshop \ Core \ Registry :: getUtilsObject ( ) -> generateUID ( ) ; $ sQ = "insert into oxobject2list ( oxid, oxobjectid, oxlistid, oxdesc ) values ( '$sUid', " . $ database -> quote ( $ sOXID ) . ", " . $ database -> quote ( $ this -> getId ( ) ) . ", " . $ database -> quote ( $ sDesc ) . " )" ; $ blAdd = $ database -> execute ( $ sQ ) ; } } return $ blAdd ; }
Add article to recommendation list

@param string $sOXID Object ID
@param string $sDesc recommended article description

@throws Exception

@return bool
Add article to recommendation list