@@ 297-305 (lines=9) @@ | ||
294 | $metadata = $this->factory->getMetadataFor($objType); |
|
295 | /* @var $metadata ObjectMetadataInterface */ |
|
296 | ||
297 | if (null !== ($discField = $metadata->getDiscriminatorField())) { |
|
298 | $discValue = $this->parseString($value, $discField->getDataPath()); |
|
299 | $discClass = $metadata->getDiscriminatorClass($discValue); |
|
300 | if ($discClass !== $objType) { |
|
301 | $this->restorePath(); |
|
302 | ||
303 | return $this->parseObject($data, $path, $discClass); |
|
304 | } |
|
305 | } |
|
306 | ||
307 | $objClass = $metadata->getClassName(); |
|
308 | $pathValue = new $objClass(); |
|
@@ 335-343 (lines=9) @@ | ||
332 | $metadata = $this->factory->getMetadataFor($resType); |
|
333 | /* @var $metadata ResourceMetadataInterface */ |
|
334 | ||
335 | if ((null !== ($discField = $metadata->getDiscriminatorField()))) { |
|
336 | $discValue = $this->parseString($value, $discField->getDataPath()); |
|
337 | $discClass = $metadata->getDiscriminatorClass($discValue); |
|
338 | if ($discClass !== $resType) { |
|
339 | $this->restorePath(); |
|
340 | ||
341 | return $this->parseResource($data, $path, $discClass); |
|
342 | } |
|
343 | } |
|
344 | ||
345 | $name = $this->parseString($value, 'type'); |
|
346 | if ($name !== $metadata->getName()) { |