Skip to content

Commit

Permalink
Merge pull request #124 from bakaphp/0.6-hotfix-cascade-delete
Browse files Browse the repository at this point in the history
[0.6] Cascade Delete
  • Loading branch information
kaioken authored May 12, 2021
2 parents e87b398 + 58a85c7 commit 00affe3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Database/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public function cascadeSoftDelete() : void
if (isset($relationData)) {
$relationData->softDelete();
}
} elseif ($data['type'] === Relation::HAS_MANY && isset($relationData[0])) {
} elseif ($data['type'] === Relation::HAS_MANY && $relationData->count()) {
foreach ($relationData as $singleData) {
$singleData->softDelete();
}
Expand Down

0 comments on commit 00affe3

Please sign in to comment.