This commit is contained in:
James Cole
2020-07-11 15:13:15 +02:00
parent 86600d4fcf
commit 54d92f5b39
20 changed files with 737 additions and 205 deletions

View File

@@ -171,4 +171,18 @@ class ObjectGroupRepository implements ObjectGroupRepositoryInterface
{
return $objectGroup->piggyBanks;
}
/**
* @inheritDoc
*/
public function deleteAll(): void
{
$all = $this->get();
/** @var ObjectGroup $group */
foreach ($all as $group) {
$group->piggyBanks()->sync([]);
$group->bills()->sync([]);
$group->delete();
}
}
}

View File

@@ -48,6 +48,10 @@ interface ObjectGroupRepositoryInterface
* Delete empty ones.
*/
public function deleteEmpty(): void;
/**
* Delete all.
*/
public function deleteAll(): void;
/**
* @param ObjectGroup $objectGroup