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


PHP OrderInterface::getState方法代码示例

本文整理汇总了PHP中Sylius\Component\Core\Model\OrderInterface::getState方法的典型用法代码示例。如果您正苦于以下问题:PHP OrderInterface::getState方法的具体用法?PHP OrderInterface::getState怎么用?PHP OrderInterface::getState使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Sylius\Component\Core\Model\OrderInterface的用法示例。


在下文中一共展示了OrderInterface::getState方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: process

 /**
  * {@inheritdoc}
  */
 public function process(OrderInterface $order)
 {
     if (OrderInterface::STATE_CANCELLED === $order->getState()) {
         return;
     }
     $this->exchangeRateUpdater->update($order);
 }
开发者ID:origammi,项目名称:Sylius,代码行数:10,代码来源:OrderExchangeRateProcessor.php

示例2:

 function it_does_not_set_order_payment_if_it_cannot_be_provided(OrderInterface $order, OrderPaymentProviderInterface $orderPaymentProvider)
 {
     $order->getState()->willReturn(OrderInterface::STATE_CART);
     $order->getLastPayment(PaymentInterface::STATE_CART)->willReturn(null);
     $orderPaymentProvider->provideOrderPayment($order, PaymentInterface::STATE_CART)->willThrow(NotProvidedOrderPaymentException::class);
     $order->addPayment(Argument::any())->shouldNotBeCalled();
     $this->process($order);
 }
开发者ID:NeverResponse,项目名称:Sylius,代码行数:8,代码来源:OrderPaymentProcessorSpec.php

示例3: processOrderPayments

 /**
  * {@inheritdoc}
  */
 public function processOrderPayments(OrderInterface $order)
 {
     if (OrderInterface::STATE_CANCELLED === $order->getState()) {
         return;
     }
     $newPayment = $order->getLastPayment(PaymentInterface::STATE_NEW);
     if (null !== $newPayment) {
         $newPayment->setAmount($order->getTotal());
         return;
     }
     /** @var $payment PaymentInterface */
     $payment = $this->paymentFactory->createWithAmountAndCurrencyCode($order->getTotal(), $order->getCurrencyCode());
     $this->setPaymentMethodIfNeeded($order, $payment);
     $order->addPayment($payment);
 }
开发者ID:TeamNovatek,项目名称:Sylius,代码行数:18,代码来源:PaymentProcessor.php

示例4:

 function it_does_not_add_a_new_payment_if_the_order_is_cancelled(OrderInterface $order)
 {
     $order->getState()->willReturn(OrderInterface::STATE_CANCELLED);
     $order->addPayment(Argument::any())->shouldNotBeCalled();
     $this->process($order);
 }
开发者ID:ReissClothing,项目名称:Sylius,代码行数:6,代码来源:OrderPaymentProcessorSpec.php

示例5:

 function it_processes_the_order(OrderUpdaterInterface $orderUpdater, OrderInterface $order)
 {
     $order->getState()->willReturn(Argument::not(OrderInterface::STATE_CANCELLED));
     $orderUpdater->update($order)->shouldBeCalled();
     $this->process($order);
 }
开发者ID:ReissClothing,项目名称:Sylius,代码行数:6,代码来源:OrderExchangeRateProcessorSpec.php

示例6: thisOrderShouldNotBeCancelled

 /**
  * @Then /^(this order) should not be cancelled$/
  */
 public function thisOrderShouldNotBeCancelled(OrderInterface $order)
 {
     Assert::notSame(OrderInterface::STATE_CANCELLED, $order->getState(), 'Order should not be cancelled, but its is.');
 }
开发者ID:sylius,项目名称:sylius,代码行数:7,代码来源:ManagingOrdersContext.php


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