mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2026-07-28 00:09:56 -07:00
Organise object groups
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Repositories\ObjectGroup;
|
||||
|
||||
/**
|
||||
* Trait OrganisesRoleGroups
|
||||
*/
|
||||
trait OrganisesObjectGroups
|
||||
{
|
||||
/**
|
||||
*
|
||||
*/
|
||||
protected function cleanupObjectGroups(): void
|
||||
{
|
||||
$this->deleteEmptyObjectGroups();
|
||||
$this->sortObjectGroups();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private function deleteEmptyObjectGroups(): void
|
||||
{
|
||||
$repository = app(ObjectGroupRepositoryInterface::class);
|
||||
$repository->deleteEmpty();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private function sortObjectGroups(): void
|
||||
{
|
||||
$repository = app(ObjectGroupRepositoryInterface::class);
|
||||
$repository->sort();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user