Skip to content

Commit 0a76c38

Browse files
committedMay 5, 2023
Use recursion to delete all child records in a tree
1 parent c3d8bd0 commit 0a76c38

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed
 

‎src/PHPFUI/ORM/Children.php

+5-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,11 @@ class Children extends \PHPFUI\ORM\VirtualField
2020
{
2121
public function delete(array $parameters) : void
2222
{
23-
$this->getTable(\array_shift($parameters))->delete();
23+
$table = $this->getTable(\array_shift($parameters));
24+
foreach ($table->getRecordCursor() as $record)
25+
{
26+
$record->delete();
27+
}
2428
}
2529

2630
/**

0 commit comments

Comments
 (0)
Please sign in to comment.