Skip to content

Commit

Permalink
Remove "table per class" inheritance that was never actually implemen…
Browse files Browse the repository at this point in the history
…ted (#10414)
  • Loading branch information
mpdude committed Jan 18, 2023
1 parent e6382d3 commit 7a08253
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 24 deletions.
1 change: 0 additions & 1 deletion docs/en/reference/php-mapping.rst
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,6 @@ Inheritance Getters
- ``isInheritanceTypeNone()``
- ``isInheritanceTypeJoined()``
- ``isInheritanceTypeSingleTable()``
- ``isInheritanceTypeTablePerClass()``
- ``isInheritedField($fieldName)``
- ``isInheritedAssociation($fieldName)``

Expand Down
1 change: 0 additions & 1 deletion doctrine-mapping.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,6 @@
<xs:restriction base="xs:token">
<xs:enumeration value="SINGLE_TABLE"/>
<xs:enumeration value="JOINED"/>
<xs:enumeration value="TABLE_PER_CLASS"/>
</xs:restriction>
</xs:simpleType>

Expand Down
20 changes: 1 addition & 19 deletions lib/Doctrine/ORM/Mapping/ClassMetadata.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,12 +167,6 @@ class ClassMetadata implements PersistenceClassMetadata, Stringable
*/
public const INHERITANCE_TYPE_SINGLE_TABLE = 3;

/**
* TABLE_PER_CLASS means the class will be persisted according to the rules
* of <tt>Concrete Table Inheritance</tt>.
*/
public const INHERITANCE_TYPE_TABLE_PER_CLASS = 4;

/* The Id generator types. */
/**
* AUTO means the generator type will depend on what the used platform prefers.
Expand Down Expand Up @@ -2040,17 +2034,6 @@ public function isInheritanceTypeSingleTable(): bool
return $this->inheritanceType === self::INHERITANCE_TYPE_SINGLE_TABLE;
}

/**
* Checks whether the mapped class uses the TABLE_PER_CLASS inheritance mapping strategy.
*
* @return bool TRUE if the class participates in a TABLE_PER_CLASS inheritance mapping,
* FALSE otherwise.
*/
public function isInheritanceTypeTablePerClass(): bool
{
return $this->inheritanceType === self::INHERITANCE_TYPE_TABLE_PER_CLASS;
}

/**
* Checks whether the class uses an identity column for the Id generation.
*/
Expand Down Expand Up @@ -2361,8 +2344,7 @@ private function isInheritanceType(int $type): bool
{
return $type === self::INHERITANCE_TYPE_NONE ||
$type === self::INHERITANCE_TYPE_SINGLE_TABLE ||
$type === self::INHERITANCE_TYPE_JOINED ||
$type === self::INHERITANCE_TYPE_TABLE_PER_CLASS;
$type === self::INHERITANCE_TYPE_JOINED;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/ORM/Mapping/InheritanceType.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#[Attribute(Attribute::TARGET_CLASS)]
final class InheritanceType implements MappingAttribute
{
/** @psalm-param 'NONE'|'JOINED'|'SINGLE_TABLE'|'TABLE_PER_CLASS' $value */
/** @psalm-param 'NONE'|'JOINED'|'SINGLE_TABLE' $value */
public function __construct(
public readonly string $value,
) {
Expand Down
2 changes: 0 additions & 2 deletions lib/Doctrine/ORM/Tools/SchemaTool.php
Original file line number Diff line number Diff line change
Expand Up @@ -283,8 +283,6 @@ public function getSchemaFromMetadata(array $classes): Schema
$table->setPrimaryKey($pkColumns);
}
}
} elseif ($class->isInheritanceTypeTablePerClass()) {
throw NotSupported::create();
} else {
$this->gatherColumns($class, $table);
$this->gatherRelationsSql($class, $table, $schema, $addedFks, $blacklistedFks);
Expand Down

0 comments on commit 7a08253

Please sign in to comment.