本文整理汇总了PHP中Sylius\Bundle\ResourceBundle\Controller\RequestConfiguration::getStateMachineGraph方法的典型用法代码示例。如果您正苦于以下问题:PHP RequestConfiguration::getStateMachineGraph方法的具体用法?PHP RequestConfiguration::getStateMachineGraph怎么用?PHP RequestConfiguration::getStateMachineGraph使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sylius\Bundle\ResourceBundle\Controller\RequestConfiguration
的用法示例。
在下文中一共展示了RequestConfiguration::getStateMachineGraph方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: apply
/**
* {@inheritdoc}
*/
public function apply(RequestConfiguration $configuration, ResourceInterface $resource)
{
if (!$configuration->hasStateMachine()) {
throw new \InvalidArgumentException('State machine must be configured to apply transition, check your routing.');
}
$this->stateMachineFactory->get($resource, $configuration->getStateMachineGraph())->apply($configuration->getStateMachineTransition());
}
示例2:
function it_applies_configured_state_machine_transition(RequestConfiguration $requestConfiguration, ResourceInterface $resource, FactoryInterface $stateMachineFactory, StateMachineInterface $stateMachine)
{
$requestConfiguration->hasStateMachine()->willReturn(true);
$requestConfiguration->getStateMachineGraph()->willReturn('sylius_product_review_state');
$requestConfiguration->getStateMachineTransition()->willReturn('reject');
$stateMachineFactory->get($resource, 'sylius_product_review_state')->willReturn($stateMachine);
$stateMachine->apply('reject')->shouldBeCalled();
$this->apply($requestConfiguration, $resource);
}