Skip to content

Latest commit

 

History

History
24 lines (17 loc) · 480 Bytes

DenormalizerContextBuilder.md

File metadata and controls

24 lines (17 loc) · 480 Bytes

DenormalizerContextBuilder

<?php

use Chubbyphp\Deserialization\Denormalizer\DenormalizerContextBuilder;
use Psr\Http\Message\ServerRequestInterface;

$request = ...;

$context = DenormalizerContextBuilder::create()
    ->setAllowedAdditionalFields(true)
    ->setGroups(['group1'])
    ->setRequest($request)
    ->getContext();

echo $context->isAllowedAdditionalFields();
// true

print_r($context->getGroups());
// ['group1']

$request = $context->getRequest();