Returns array of basket costs. By passing cost identifier method will return
this cost if available

@param string $sId cost id ( optional )

@return array|\OxidEsales\Eshop\Core\Price|null
513794
public function getCosts($sId = null)
    {
        // if user want some specific cost - return it
        if ($sId) {
            return isset($this->_aCosts[$sId]) ? $this->_aCosts[$sId] : null;
        }

        return $this->_aCosts;
    }
1148864
protected function _getOrderBasketItems($oDiscount = null)
    {
        if (is_null($oDiscount)) {
            $oDiscount = $this->_getSerieDiscount();
        }

        $oOrder = oxNew(\OxidEsales\Eshop\Application\Model\Order::class);
        $oOrder->load($this->oxvouchers__oxorderid->value);

        $aItems = [];
        $iCount = 0;

        foreach ($oOrder->getOrderArticles(true) as $oOrderArticle) {
            if (!$oOrderArticle->skipDiscounts() && $oDiscount->isForBasketItem($oOrderArticle)) {
                $aItems[$iCount] = [
                    'oxid'     => $oOrderArticle->getProductId(),
                    'price'    => $oOrderArticle->oxorderarticles__oxbprice->value,
                    'discount' => $oDiscount->getAbsValue($oOrderArticle->oxorderarticles__oxbprice->value),
                    'amount'   => $oOrderArticle->oxorderarticles__oxamount->value,
                ];
                $iCount++;
            }
        }

        return $aItems;
    }
1004479
public function getBuyablePrice($options = null)
    {
        if (property_exists($this, 'price'))        return $this->price;
        if (property_exists($this, 'cost'))         return $this->cost;
        if (property_exists($this, 'value'))        return $this->value;

        return null;
    }
482374
private function groupSecurityIdentities(array $sids)
    {
        $groupSids = [];

        if (null === $this->sharingManager) {
            throw new InvalidArgumentException('The "setSharingManager()" must be called before');
        }

        foreach ($sids as $sid) {
            if (IdentityUtils::isValid($sid)) {
                $type = $this->sharingManager->getIdentityConfig($sid->getType())->getType();
                $groupSids[$type][] = $sid->getIdentifier();
            }
        }

        return $groupSids;
    }
994463
private function getUserFromSession($sid) {
        $session = $this->entityManager->getRepository("Emeric0101\PHPAngular\Entity\Session")->findBySid($sid);
        if (empty($session)) {
            return null;
        }
        // fix some bug with entity conflit
        $userLogged = $this->entityManager->find("Emeric0101\PHPAngular\Entity\IUser", $session[0]->getUser()->getId());

        return $userLogged;
    }
758903
public function setId($sId = null)
    {
        $sId = parent::setId($sId);

        // TODO: in \OxidEsales\Eshop\Core\Model\BaseModel::setId make it to check if exists and update, not recreate, then delete this overload
        $this->oxarticles__oxnid = $this->oxarticles__oxid;

        return $sId;
    }
8172
public function getContext($sid) {
        return new FactorContext(
            $this->version,
            $this->solution['serviceSid'],
            $this->solution['identity'],
            $sid
        );
    }
660112
public function getOrderCost($oid = 0) {
    $account = \Drupal::currentUser();
    $query = $this->connection->select('site_cart', 'n');
    $query->fields('n', array('quantity', 'cost'));

    if ($oid) {
      $query->condition('n.oid', $oid);
    } else {
      $query->condition('n.oid', 0);

      if ($account->id()) {
        $query->condition('uid', $account->id());
      } else {
        $query->condition('uid_hash', kvantstudio_user_hash());
      }
    }

    $result = $query->execute();

    $cost = 0;
    foreach ($result as $row) {
      $cost = $cost + ($row->quantity * $row->cost);
    }

    $cost = \Drupal::service('kvantstudio.formatter')->price($cost);
    return $cost;
  }
853394
public function getBidPrice()
    {
        if ($this->_sBidPrice === null) {
            $this->_sBidPrice = false;

            $parameters = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('pa');
            $activeCurrency = \OxidEsales\Eshop\Core\Registry::getConfig()->getActShopCurrencyObject();
            $price = \OxidEsales\Eshop\Core\Registry::getUtils()->currency2Float($parameters['price']);
            $this->_sBidPrice = \OxidEsales\Eshop\Core\Registry::getLang()->formatCurrency($price, $activeCurrency);
        }

        return $this->_sBidPrice;
    }
695494
protected function _getShippingId()
    {
        /** @var OxpsPaymorrowOxBasket|oxBasket $this */

        $sId = (string) $this->getShippingId();

        if ( !empty( $sId ) ) {
            $sId = $this->_toUtf( $sId );
        } else {
            $sId = 'shippingCosts';
        }

        return $sId;
    }
566554
public static function GetInstance($sId)
    {
        $oRealObject = null;
        $oObject = TdbShopVariantDisplayHandler::GetNewInstance();
        /** @var $oObject TdbShopVariantDisplayHandler */
        if ($oObject->Load($sId)) {
            $sClassName = $oObject->fieldClass;
            $oRealObject = new $sClassName();
            $oRealObject->LoadFromRow($oObject->sqlData);
        }

        return $oRealObject;
    }
1307465
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];
    }
1105101
protected function _getReservationsId()
    {
        $sId = \OxidEsales\Eshop\Core\Registry::getSession()->getVariable('basketReservationToken');
        if (!$sId) {
            $utilsObject = $this->getUtilsObjectInstance();
            $sId = $utilsObject->generateUId();
            \OxidEsales\Eshop\Core\Registry::getSession()->setVariable('basketReservationToken', $sId);
        }

        return $sId;
    }
1237116
public function getContext($sid) {
        return new AuthCallsIpAccessControlListMappingContext(
            $this->version,
            $this->solution['accountSid'],
            $this->solution['domainSid'],
            $sid
        );
    }
1180723
public function getObjectAce($objectIdentity, $sid)
    {
        $this->enforceObjectIdentity($objectIdentity);
        $this->enforceSecurityIdentity($sid);

        $acl = $this->securityContext->getACLProvider()->findAcl($objectIdentity);

        foreach ($acl->getObjectAces() as $index => $ace) {
            if ($ace->getSecurityIdentity()->equals($sid)) {
                return $ace;
            }
        }
        throw new InvalidArgumentException('ACE not found for the supplied combination of ObjectIdentity and SecurityIdentity');
    }
770335
private function retrievePriceByCurrency(array &$prices, $currencyId)
    {
        /** @var ProductPrice $price */
        foreach ($prices as $index => $price) {
            if ($currencyId === $price->getCurrency()->getId()) {
                unset($prices[$index]);

                return $price;
            }
        }

        return null;
    }
196296
protected function _isInDisabledList($sId)
    {
        return in_array($sId, (array) \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('aDisabledModules'));
    }