Skip to content

Commit

Permalink
add / discriminator for classes in the middle of hierarchy
Browse files Browse the repository at this point in the history
  • Loading branch information
dan committed Sep 13, 2016
1 parent 54f5468 commit 91caff5
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/JMS/Serializer/Metadata/ClassMetadata.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,13 @@ public function merge(MergeableInterface $object)
$this->discriminatorBaseClass = $object->discriminatorBaseClass;
}

if ($object->discriminatorMap) {

$this->discriminatorFieldName = $object->discriminatorFieldName;
$this->discriminatorMap = $object->discriminatorMap;
$this->discriminatorBaseClass = $object->discriminatorBaseClass;
}

if ($this->discriminatorMap && ! $this->reflection->isAbstract()) {
if (false === $typeValue = array_search($this->name, $this->discriminatorMap, true)) {
throw new \LogicException(sprintf(
Expand Down

0 comments on commit 91caff5

Please sign in to comment.