source/Application/Model/UserBasket.php
protected function _createItem($sProductId, $aSelList = null, $aPersParams = null)
    {
        $oNewItem = oxNew(\OxidEsales\Eshop\Application\Model\UserBasketItem::class);
        $oNewItem->oxuserbasketitems__oxartid = new \OxidEsales\Eshop\Core\Field($sProductId, \OxidEsales\Eshop\Core\Field::T_RAW);
        $oNewItem->oxuserbasketitems__oxbasketid = new \OxidEsales\Eshop\Core\Field($this->getId(), \OxidEsales\Eshop\Core\Field::T_RAW);
        if ($aPersParams && count($aPersParams)) {
            $oNewItem->setPersParams($aPersParams);
        }

        if (!$aSelList) {
            $oArticle = oxNew(\OxidEsales\Eshop\Application\Model\Article::class);
            $oArticle->load($sProductId);
            $aSelectLists = $oArticle->getSelectLists();
            if (($iSelCnt = count($aSelectLists))) {
                $aSelList = array_fill(0, $iSelCnt, '0');
            }
        }

        $oNewItem->setSelList($aSelList);

        return $oNewItem;
    }
protected function _createItem($sProductId, $aSelList = null, $aPersParams = null)
    {
        $oNewItem = oxNew(\OxidEsales\Eshop\Application\Model\UserBasketItem::class);
        $oNewItem->oxuserbasketitems__oxartid = new \OxidEsales\Eshop\Core\Field($sProductId, \OxidEsales\Eshop\Core\Field::T_RAW);
        $oNewItem->oxuserbasketitems__oxbasketid = new \OxidEsales\Eshop\Core\Field($this->getId(), \OxidEsales\Eshop\Core\Field::T_RAW);
        if ($aPersParams && count($aPersParams)) {
            $oNewItem->setPersParams($aPersParams);
        }

        if (!$aSelList) {
            $oArticle = oxNew(\OxidEsales\Eshop\Application\Model\Article::class);
            $oArticle->load($sProductId);
            $aSelectLists = $oArticle->getSelectLists();
            if (($iSelCnt = count($aSelectLists))) {
                $aSelList = array_fill(0, $iSelCnt, '0');
            }
        }

        $oNewItem->setSelList($aSelList);

        return $oNewItem;
    }
protected function _createItem ( $ sProductId , $ aSelList = null , $ aPersParams = null ) { $ oNewItem = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ UserBasketItem :: class ) ; $ oNewItem -> oxuserbasketitems__oxartid = new \ OxidEsales \ Eshop \ Core \ Field ( $ sProductId , \ OxidEsales \ Eshop \ Core \ Field :: T_RAW ) ; $ oNewItem -> oxuserbasketitems__oxbasketid = new \ OxidEsales \ Eshop \ Core \ Field ( $ this -> getId ( ) , \ OxidEsales \ Eshop \ Core \ Field :: T_RAW ) ; if ( $ aPersParams && count ( $ aPersParams ) ) { $ oNewItem -> setPersParams ( $ aPersParams ) ; } if ( ! $ aSelList ) { $ oArticle = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ Article :: class ) ; $ oArticle -> load ( $ sProductId ) ; $ aSelectLists = $ oArticle -> getSelectLists ( ) ; if ( ( $ iSelCnt = count ( $ aSelectLists ) ) ) { $ aSelList = array_fill ( 0 , $ iSelCnt , '0' ) ; } } $ oNewItem -> setSelList ( $ aSelList ) ; return $ oNewItem ; }
Creates and returns  oxuserbasketitem object

@param string $sProductId  Product Id
@param array  $aSelList    product select lists
@param string $aPersParams persistent parameters

@return oxUserBasketItem
Creates and returns oxuserbasketitem object