Skip to content

Commit

Permalink
Revert "Fix SchemaValidator with abstract child class in discriminato…
Browse files Browse the repository at this point in the history
…r map (#9096)" (#9262)

This reverts commit bbb68d0.
  • Loading branch information
olsavmic authored Dec 18, 2021
1 parent 02a4e40 commit 5bf8140
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 41 deletions.
2 changes: 1 addition & 1 deletion lib/Doctrine/ORM/Tools/SchemaValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ public function validateClass(ClassMetadataInfo $class)
}
}

if (! $class->isInheritanceTypeNone() && ! $class->isRootEntity() && ! $class->reflClass->isAbstract() && ! $class->isMappedSuperclass && array_search($class->name, $class->discriminatorMap, true) === false) {
if (! $class->isInheritanceTypeNone() && ! $class->isRootEntity() && ! $class->isMappedSuperclass && array_search($class->name, $class->discriminatorMap, true) === false) {
$ce[] = "Entity class '" . $class->name . "' is part of inheritance hierarchy, but is " .
"not mapped in the root entity '" . $class->rootEntityName . "' discriminator map. " .
'All subclasses must be listed in the discriminator map.';
Expand Down
40 changes: 0 additions & 40 deletions tests/Doctrine/Tests/ORM/Tools/SchemaValidatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -225,17 +225,6 @@ public function testMappedSuperclassNotPresentInDiscriminator(): void

$this->assertEquals([], $ce);
}

/**
* @group 9095
*/
public function testAbstractChildClassNotPresentInDiscriminator(): void
{
$class1 = $this->em->getClassMetadata(Issue9095AbstractChild::class);
$ce = $this->validator->validateClass($class1);

$this->assertEquals([], $ce);
}
}

/**
Expand Down Expand Up @@ -267,35 +256,6 @@ class ChildEntity extends MappedSuperclassEntity
{
}

/**
* @Entity
* @InheritanceType("SINGLE_TABLE")
* @DiscriminatorMap({"child" = Issue9095Child::class})
*/
abstract class Issue9095Parent
{
/**
* @var mixed
* @Id
* @Column
*/
protected $key;
}

/**
* @Entity
*/
abstract class Issue9095AbstractChild extends Issue9095Parent
{
}

/**
* @Entity
*/
class Issue9095Child extends Issue9095AbstractChild
{
}

/**
* @Entity
*/
Expand Down

0 comments on commit 5bf8140

Please sign in to comment.