mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
38 lines
680 B
PHP
38 lines
680 B
PHP
|
<?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();
|
||
|
}
|
||
|
}
|