当前位置: 首页>>代码示例>>PHP>>正文


PHP OrderInterface::getId方法代码示例

本文整理汇总了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);
 }
开发者ID:TheMadeleine,项目名称:Sylius,代码行数:27,代码来源:ConvertPaymentActionSpec.php

示例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);
 }
开发者ID:gabiudrescu,项目名称:Sylius,代码行数:14,代码来源:ManagingOrdersContext.php

示例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);
 }
开发者ID:Spomky,项目名称:Sylius,代码行数:17,代码来源:FinalizeStep.php

示例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);
 }
开发者ID:Mangetsu,项目名称:Sylius,代码行数:23,代码来源:FinalizeStep.php

示例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()]);
 }
开发者ID:GSadee,项目名称:Sylius,代码行数:7,代码来源:ManagingOrdersContext.php

示例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');
     });
 }
开发者ID:sylius,项目名称:sylius,代码行数:10,代码来源:ManagingOrdersContext.php

示例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]);
 }
开发者ID:starspire,项目名称:eventmanager,代码行数:6,代码来源:OrderContextSpec.php

示例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));
     });
 }
开发者ID:okwinza,项目名称:Sylius,代码行数:10,代码来源:ManagingOrdersContext.php

示例9: iSeeTheOrder

 /**
  * @When I view the summary of the order :order
  */
 public function iSeeTheOrder(OrderInterface $order)
 {
     $this->showPage->open(['id' => $order->getId()]);
 }
开发者ID:polisys,项目名称:Sylius,代码行数:7,代码来源:ManagingOrdersContext.php

示例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.');
 }
开发者ID:loic425,项目名称:Sylius,代码行数:8,代码来源:CartContext.php


注:本文中的Sylius\Component\Core\Model\OrderInterface::getId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。