Sylius\Behat\Context\Setup\OrderContext::createCart PHP Method

createCart() private method

private createCart ( Sylius\Component\Customer\Model\CustomerInterface $customer, Sylius\Component\Core\Model\ChannelInterface $channel = null, string | null $currencyCode = null, string | null $localeCode = null ) : Sylius\Component\Core\Model\OrderInterface
$customer Sylius\Component\Customer\Model\CustomerInterface
$channel Sylius\Component\Core\Model\ChannelInterface
$currencyCode string | null
$localeCode string | null
return Sylius\Component\Core\Model\OrderInterface
    private function createCart(CustomerInterface $customer, ChannelInterface $channel = null, $currencyCode = null, $localeCode = null)
    {
        /** @var OrderInterface $order */
        $order = $this->orderFactory->createNew();
        $order->setCustomer($customer);
        $order->setChannel(null !== $channel ? $channel : $this->sharedStorage->get('channel'));
        $order->setLocaleCode(null !== $localeCode ? $localeCode : $this->sharedStorage->get('locale')->getCode());
        $currencyCode = $currencyCode ? $currencyCode : $order->getChannel()->getBaseCurrency()->getCode();
        $currency = $this->currencyRepository->findOneBy(['code' => $currencyCode]);
        $order->setCurrencyCode($currency->getCode());
        return $order;
    }