本文整理汇总了PHP中Sylius\Component\Core\Model\OrderInterface::getId方法的典型用法代码示例。如果您正苦于以下问题:PHP OrderInterface::getId方法的具体用法?PHP OrderInterface::getId怎么用?PHP OrderInterface::getId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sylius\Component\Core\Model\OrderInterface
的用法示例。
在下文中一共展示了OrderInterface::getId方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
function it_executes_request(InvoiceNumberGeneratorInterface $invoiceNumberGenerator, CurrencyConverterInterface $currencyConverter, Convert $request, PaymentInterface $payment, OrderInterface $order, OrderItemInterface $orderItem, ProductVariantInterface $productVariant, ProductInterface $product)
{
$request->getTo()->willReturn('array');
$payment->getId()->willReturn(19);
$order->getId()->willReturn(92);
$order->getId()->willReturn(92);
$order->getCurrencyCode()->willReturn('PLN');
$order->getTotal()->willReturn(22000);
$order->getItems()->willReturn([$orderItem]);
$order->getAdjustmentsTotalRecursively(AdjustmentInterface::TAX_ADJUSTMENT)->willReturn(0);
$order->getOrderPromotionTotal()->willReturn(0);
$order->getShippingTotal()->willReturn(2000);
$orderItem->getVariant()->willReturn($productVariant);
$orderItem->getDiscountedUnitPrice()->willReturn(20000);
$orderItem->getQuantity()->willReturn(1);
$productVariant->getProduct()->willReturn($product);
$product->getName()->willReturn('Lamborghini Aventador Model');
$request->getSource()->willReturn($payment);
$payment->getOrder()->willReturn($order);
$invoiceNumberGenerator->generate($order, $payment)->willReturn('19-92');
$currencyConverter->convertFromBase(22000, 'PLN')->willReturn(88000);
$currencyConverter->convertFromBase(20000, 'PLN')->willReturn(80000);
$currencyConverter->convertFromBase(2000, 'PLN')->willReturn(8000);
$details = ['PAYMENTREQUEST_0_INVNUM' => '19-92', 'PAYMENTREQUEST_0_CURRENCYCODE' => 'PLN', 'PAYMENTREQUEST_0_AMT' => 880.0, 'PAYMENTREQUEST_0_ITEMAMT' => 880.0, 'L_PAYMENTREQUEST_0_NAME0' => 'Lamborghini Aventador Model', 'L_PAYMENTREQUEST_0_AMT0' => 800.0, 'L_PAYMENTREQUEST_0_QTY0' => 1, 'L_PAYMENTREQUEST_0_NAME1' => 'Shipping Total', 'L_PAYMENTREQUEST_0_AMT1' => 80.0, 'L_PAYMENTREQUEST_0_QTY1' => 1];
$request->setResult($details)->shouldBeCalled();
$this->execute($request);
}
示例2: iDeleteTheOrder
/**
* @When I delete the order :order
*/
public function iDeleteTheOrder(OrderInterface $order)
{
$adjustmentsId = [];
foreach ($order->getAdjustments() as $adjustment) {
$adjustmentsId[] = $adjustment->getId();
}
$this->sharedStorage->set('deleted_adjustments', $adjustmentsId);
$this->sharedStorage->set('deleted_addresses', [$order->getShippingAddress()->getId(), $order->getBillingAddress()->getId()]);
$this->sharedStorage->set('order_id', $order->getId());
$this->orderRepository->remove($order);
}
示例3: completeOrder
/**
* Mark the order as completed.
*
* @param OrderInterface $order
*/
protected function completeOrder(OrderInterface $order)
{
$this->get('session')->set('sylius_order_id', $order->getId());
$this->dispatchCheckoutEvent(SyliusOrderEvents::PRE_CREATE, $order);
$this->dispatchCheckoutEvent(SyliusCheckoutEvents::FINALIZE_PRE_COMPLETE, $order);
$this->get('sm.factory')->get($order, OrderTransitions::GRAPH)->apply(OrderTransitions::SYLIUS_CREATE, true);
$manager = $this->get('sylius.manager.order');
$manager->persist($order);
$manager->flush();
$this->dispatchCheckoutEvent(SyliusCheckoutEvents::FINALIZE_COMPLETE, $order);
$this->dispatchCheckoutEvent(SyliusOrderEvents::POST_CREATE, $order);
}
示例4: completeOrder
/**
* Mark the order as completed.
*
* @param OrderInterface $order
*/
protected function completeOrder(OrderInterface $order)
{
$this->get('session')->set('sylius_order_id', $order->getId());
$currencyProvider = $this->get('sylius.currency_provider');
$this->dispatchCheckoutEvent(SyliusOrderEvents::PRE_CREATE, $order);
$this->dispatchCheckoutEvent(SyliusCheckoutEvents::FINALIZE_PRE_COMPLETE, $order);
$this->get('sm.factory')->get($order, OrderTransitions::GRAPH)->apply(OrderTransitions::SYLIUS_CREATE, true);
if ($order->getCurrency() !== $currencyProvider->getBaseCurrency()) {
$currencyRepository = $this->get('sylius.repository.currency');
$currency = $currencyRepository->findOneBy(['code' => $order->getCurrency()]);
$order->setExchangeRate($currency->getExchangeRate());
}
$manager = $this->get('sylius.manager.order');
$manager->persist($order);
$manager->flush();
$this->dispatchCheckoutEvent(SyliusCheckoutEvents::FINALIZE_COMPLETE, $order);
$this->dispatchCheckoutEvent(SyliusOrderEvents::POST_CREATE, $order);
}
示例5: iWantToModifyACustomerSShippingAddress
/**
* @When /^I want to modify a customer's shipping address of (this order)$/
*/
public function iWantToModifyACustomerSShippingAddress(OrderInterface $order)
{
$this->updateShippingAddressPage->open(['id' => $order->getId()]);
}
示例6: theAdministratorShouldSeeThatThisOrderHasBeenPlacedIn
/**
* @Then /^(the administrator) should see that (order placed by "[^"]+") has "([^"]+)" currency$/
*/
public function theAdministratorShouldSeeThatThisOrderHasBeenPlacedIn(AdminUserInterface $user, OrderInterface $order, $currency)
{
$this->sharedSecurityService->performActionAsAdminUser($user, function () use($order, $currency) {
$this->showPage->open(['id' => $order->getId()]);
Assert::same($this->showPage->getOrderCurrency(), $currency, 'The order has been placed in %s, but it was expected to be placed in %s');
});
}
示例7:
function it_throws_an_exception_if_order_still_exists(OrderRepositoryInterface $orderRepository, OrderInterface $order)
{
$order->getId()->willReturn(1);
$orderRepository->find(1)->willReturn($order);
$this->shouldThrow(NotEqualException::class)->during('orderShouldNotExistInTheRegistry', [$order]);
}
示例8: theCustomerServiceShouldKnowAboutThisAdditionalNotes
/**
* @Then /^(the administrator) should know about (this additional note) for (this order made by "[^"]+")$/
*/
public function theCustomerServiceShouldKnowAboutThisAdditionalNotes(UserInterface $user, $note, OrderInterface $order)
{
$this->securityService->performActionAs($user, function () use($note, $order) {
$this->showPage->open(['id' => $order->getId()]);
Assert::true($this->showPage->hasNote($note), sprintf('I should see %s note, but I do not see', $note));
});
}
示例9: iSeeTheOrder
/**
* @When I view the summary of the order :order
*/
public function iSeeTheOrder(OrderInterface $order)
{
$this->showPage->open(['id' => $order->getId()]);
}
示例10: thisCartShouldNotBeDeleted
/**
* @Then /^(this cart) should not be deleted$/
*/
public function thisCartShouldNotBeDeleted(OrderInterface $cart)
{
$this->expiredCartsRemover->remove();
Assert::notNull($cart->getId(), 'This cart should be in registry but it is not.');
}