Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove concrete table inheritance #10414

Merged
merged 1 commit into from
Jan 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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 @@ -164,12 +164,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 @@ -1988,17 +1982,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 @@ -2309,8 +2292,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