firefly-iii/app/Repositories/ObjectGroup/OrganisesObjectGroups.php
2020-06-07 16:38:15 +02:00

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();
}
}