Skip to content

Commit 7fc12f4

Browse files
committed
enable deleteWithRelation()
1 parent d568c4c commit 7fc12f4

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

RelationTrait.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -260,14 +260,12 @@ public function deleteWithRelated($skippedRelations = [])
260260
if ($data['ismultiple'] && !in_array($data['name'], $skippedRelations)) {
261261
$link = $data['link'];
262262
if (count($this->{$data['name']})) {
263-
$relPKAttr = $this->{$data['name']}[0]->primaryKey();
264-
// $isCompositePK = (count($relPKAttr) > 1); // unused
265263
foreach ($link as $key => $value) {
266264
if (isset($this->$value)) {
267265
$array[$key] = $this->$value;
268266
}
269267
}
270-
// $error = !$this->{$data['name']}[0]->deleteAll(['and', $array]);
268+
$error = !$this->{$data['name']}[0]->deleteAll(['and', $array]);
271269
}
272270
}
273271
}

0 commit comments

Comments
 (0)