mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2024-12-28 01:41:14 -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();
|
|
}
|
|
}
|