protected function getCart(ShopInterface $shop, ClientInterface $client = null, $sessionId, $currency)
    {
        $cart = $this->repository->findCart($client, $sessionId, $shop);

        if (null === $cart) {
            $cart = $this->createCart($shop, $client);
        } else {
            $this->updateCart($cart, $client, $currency);
        }

        return $cart;
    }
protected function getCart(ShopInterface $shop, ClientInterface $client = null, $sessionId, $currency)
    {
        $cart = $this->repository->findCart($client, $sessionId, $shop);

        if (null === $cart) {
            $cart = $this->createCart($shop, $client);
        } else {
            $this->updateCart($cart, $client, $currency);
        }

        return $cart;
    }
protected function getCart ( ShopInterface $ shop , ClientInterface $ client = null , $ sessionId , $ currency ) { $ cart = $ this -> repository -> findCart ( $ client , $ sessionId , $ shop ) ; if ( null === $ cart ) { $ cart = $ this -> createCart ( $ shop , $ client ) ; } else { $ this -> updateCart ( $ cart , $ client , $ currency ) ; } return $ cart ; }
Returns an existent cart or creates a new one if needed

@param ShopInterface        $shop
@param ClientInterface|null $client
@param string               $sessionId
@param string               $currency

@return CartInterface
Returns an existent cart or creates a new one if needed