mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
type variable added and file renamed in transformer
This commit is contained in:
parent
420f81ea24
commit
6d07168529
@ -25,13 +25,16 @@ class UserToJsonTransformer implements DataTransformerInterface
|
|||||||
|
|
||||||
private bool $multiple;
|
private bool $multiple;
|
||||||
|
|
||||||
|
private string $type;
|
||||||
|
|
||||||
private SerializerInterface $serializer;
|
private SerializerInterface $serializer;
|
||||||
|
|
||||||
public function __construct(DenormalizerInterface $denormalizer, SerializerInterface $serializer, bool $multiple)
|
public function __construct(DenormalizerInterface $denormalizer, SerializerInterface $serializer, bool $multiple, string $type)
|
||||||
{
|
{
|
||||||
$this->denormalizer = $denormalizer;
|
$this->denormalizer = $denormalizer;
|
||||||
$this->serializer = $serializer;
|
$this->serializer = $serializer;
|
||||||
$this->multiple = $multiple;
|
$this->multiple = $multiple;
|
||||||
|
$this->type = $type;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function reverseTransform($value)
|
public function reverseTransform($value)
|
||||||
@ -78,7 +81,7 @@ class UserToJsonTransformer implements DataTransformerInterface
|
|||||||
|
|
||||||
return
|
return
|
||||||
$this->denormalizer->denormalize(
|
$this->denormalizer->denormalize(
|
||||||
['type' => $item['type'], 'id' => $item['id']],
|
['type' => $this->type, 'id' => $item['id']],
|
||||||
User::class,
|
User::class,
|
||||||
'json',
|
'json',
|
||||||
[AbstractNormalizer::GROUPS => ['read']],
|
[AbstractNormalizer::GROUPS => ['read']],
|
Loading…
x
Reference in New Issue
Block a user