Skip to content

Commit

Permalink
Move a check up (continue early)
Browse files Browse the repository at this point in the history
  • Loading branch information
mpdude committed Jun 21, 2023
1 parent ba089e5 commit c235901
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ final protected function updateTable(
protected function deleteJoinTableRecords(array $identifier, array $types): void
{
foreach ($this->class->associationMappings as $mapping) {
if ($mapping['type'] !== ClassMetadata::MANY_TO_MANY) {
if ($mapping['type'] !== ClassMetadata::MANY_TO_MANY || isset($mapping['isOnDeleteCascade'])) {
continue;
}

Expand Down Expand Up @@ -574,10 +574,6 @@ protected function deleteJoinTableRecords(array $identifier, array $types): void
$otherKeys[] = $this->quoteStrategy->getJoinColumnName($joinColumn, $class, $this->platform);
}

if (isset($mapping['isOnDeleteCascade'])) {
continue;
}

$joinTableName = $this->quoteStrategy->getJoinTableName($association, $this->class, $this->platform);

$this->conn->delete($joinTableName, array_combine($keys, $identifier), $types);
Expand Down

0 comments on commit c235901

Please sign in to comment.