本文整理汇总了PHP中Sylius\Bundle\ResourceBundle\Controller\RequestConfiguration::getSerializationVersion方法的典型用法代码示例。如果您正苦于以下问题:PHP RequestConfiguration::getSerializationVersion方法的具体用法?PHP RequestConfiguration::getSerializationVersion怎么用?PHP RequestConfiguration::getSerializationVersion使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sylius\Bundle\ResourceBundle\Controller\RequestConfiguration
的用法示例。
在下文中一共展示了RequestConfiguration::getSerializationVersion方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: handle
/**
* {@inheritdoc}
*/
public function handle(RequestConfiguration $requestConfiguration, View $view)
{
if (!$requestConfiguration->isHtmlRequest()) {
$this->restViewHandler->setExclusionStrategyGroups($requestConfiguration->getSerializationGroups());
if ($version = $requestConfiguration->getSerializationVersion()) {
$this->restViewHandler->setExclusionStrategyVersion($version);
}
$view->getSerializationContext()->enableMaxDepthChecks();
}
return $this->restViewHandler->handle($view);
}
示例2: SerializationContext
function it_sets_proper_values_for_non_html_requests(RequestConfiguration $requestConfiguration, RestViewHandler $restViewHandler, Response $response)
{
$requestConfiguration->isHtmlRequest()->willReturn(false);
$view = View::create();
$view->setSerializationContext(new SerializationContext());
$requestConfiguration->getSerializationGroups()->willReturn(['Detailed']);
$requestConfiguration->getSerializationVersion()->willReturn('2.0.0');
$restViewHandler->setExclusionStrategyGroups(['Detailed'])->shouldBeCalled();
$restViewHandler->setExclusionStrategyVersion('2.0.0')->shouldBeCalled();
$restViewHandler->handle($view)->willReturn($response);
$this->handle($requestConfiguration, $view)->shouldReturn($response);
}