src/Denormalizer/ReferenceFieldDenormalizer.php 1 location
|
@@ 61-67 (lines=7) @@
|
58 |
|
throw DeserializerLogicException::createMissingDenormalizer($path); |
59 |
|
} |
60 |
|
|
61 |
|
if (is_array($value)) { |
62 |
|
$existingValue = $this->accessor->getValue($object) ?? $this->class; |
63 |
|
|
64 |
|
$this->accessor->setValue($object, $denormalizer->denormalize($existingValue, $value, $context)); |
65 |
|
|
66 |
|
return; |
67 |
|
} |
68 |
|
|
69 |
|
if (is_string($value)) { |
70 |
|
if (null === $repository = $this->repository) { |
src/Denormalizer/Relation/EmbedOneFieldDenormalizer.php 1 location
|
@@ 63-69 (lines=7) @@
|
60 |
|
throw DeserializerLogicException::createMissingDenormalizer($path); |
61 |
|
} |
62 |
|
|
63 |
|
if (is_array($value)) { |
64 |
|
$existingValue = $this->accessor->getValue($object) ?? $this->class; |
65 |
|
|
66 |
|
$this->accessor->setValue($object, $denormalizer->denormalize($existingValue, $value, $context)); |
67 |
|
|
68 |
|
return; |
69 |
|
} |
70 |
|
|
71 |
|
throw DeserializerRuntimeException::createInvalidDataType($path, gettype($value), 'array'); |
72 |
|
} |