source/Application/Model/User.php
public function getBasket($sName)
    {
        if (!isset($this->_aBaskets[$sName])) {
            /** @var \OxidEsales\Eshop\Application\Model\UserBasket $oBasket */
            $oBasket = oxNew(\OxidEsales\Eshop\Application\Model\UserBasket::class);
            $aWhere = ['oxuserbaskets.oxuserid' => $this->getId(), 'oxuserbaskets.oxtitle' => $sName];

            // creating if it does not exist
            if (!$oBasket->assignRecord($oBasket->buildSelectString($aWhere))) {
                $oBasket->oxuserbaskets__oxtitle = new \OxidEsales\Eshop\Core\Field($sName);
                $oBasket->oxuserbaskets__oxuserid = new \OxidEsales\Eshop\Core\Field($this->getId());

                // marking basket as new (it will not be saved in DB yet)
                $oBasket->setIsNewBasket();
            }

            $this->_aBaskets[$sName] = $oBasket;
        }

        return $this->_aBaskets[$sName];
    }
public function getBasket($sName)
    {
        if (!isset($this->_aBaskets[$sName])) {
            /** @var \OxidEsales\Eshop\Application\Model\UserBasket $oBasket */
            $oBasket = oxNew(\OxidEsales\Eshop\Application\Model\UserBasket::class);
            $aWhere = ['oxuserbaskets.oxuserid' => $this->getId(), 'oxuserbaskets.oxtitle' => $sName];

            // creating if it does not exist
            if (!$oBasket->assignRecord($oBasket->buildSelectString($aWhere))) {
                $oBasket->oxuserbaskets__oxtitle = new \OxidEsales\Eshop\Core\Field($sName);
                $oBasket->oxuserbaskets__oxuserid = new \OxidEsales\Eshop\Core\Field($this->getId());

                // marking basket as new (it will not be saved in DB yet)
                $oBasket->setIsNewBasket();
            }

            $this->_aBaskets[$sName] = $oBasket;
        }

        return $this->_aBaskets[$sName];
    }
public function getBasket ( $ sName ) { if ( ! isset ( $ this -> _aBaskets [ $ sName ] ) ) { /** @var \OxidEsales\Eshop\Application\Model\UserBasket $oBasket */ $ oBasket = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ UserBasket :: class ) ; $ aWhere = [ 'oxuserbaskets.oxuserid' => $ this -> getId ( ) , 'oxuserbaskets.oxtitle' => $ sName ] ; // creating if it does not exist if ( ! $ oBasket -> assignRecord ( $ oBasket -> buildSelectString ( $ aWhere ) ) ) { $ oBasket -> oxuserbaskets__oxtitle = new \ OxidEsales \ Eshop \ Core \ Field ( $ sName ) ; $ oBasket -> oxuserbaskets__oxuserid = new \ OxidEsales \ Eshop \ Core \ Field ( $ this -> getId ( ) ) ; // marking basket as new (it will not be saved in DB yet) $ oBasket -> setIsNewBasket ( ) ; } $ this -> _aBaskets [ $ sName ] = $ oBasket ; } return $ this -> _aBaskets [ $ sName ] ; }
Returns notice, wishlist or saved basket object

@param string $sName name/type of basket

@return \OxidEsales\Eshop\Application\Model\UserBasket
Returns notice wishlist or saved basket object