Files
firefly-iii/app/Repositories/ObjectGroup/ObjectGroupRepositoryInterface.php

104 lines
2.5 KiB
PHP
Raw Normal View History

2020-06-07 11:31:01 +02:00
<?php
2020-06-30 19:05:35 +02:00
/**
* ObjectGroupRepositoryInterface.php
* Copyright (c) 2020 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
2020-06-07 11:31:01 +02:00
declare(strict_types=1);
namespace FireflyIII\Repositories\ObjectGroup;
2020-06-20 10:10:55 +02:00
use FireflyIII\Models\ObjectGroup;
2021-04-05 21:52:55 +02:00
use FireflyIII\User;
2020-06-07 11:31:01 +02:00
use Illuminate\Support\Collection;
/**
* Interface ObjectGroupRepositoryInterface
*/
interface ObjectGroupRepositoryInterface
{
/**
2021-03-12 06:20:01 +01:00
* Delete all.
2020-06-07 11:31:01 +02:00
*/
2021-03-12 06:20:01 +01:00
public function deleteAll(): void;
2020-06-07 11:31:01 +02:00
/**
2021-03-12 06:20:01 +01:00
* Delete empty ones.
2020-06-07 11:31:01 +02:00
*/
2021-03-12 06:20:01 +01:00
public function deleteEmpty(): void;
2020-06-07 11:31:01 +02:00
2020-06-07 16:38:15 +02:00
/**
2022-12-29 19:42:26 +01:00
* @param ObjectGroup $objectGroup
2020-06-07 16:38:15 +02:00
*/
2021-03-12 06:20:01 +01:00
public function destroy(ObjectGroup $objectGroup): void;
2020-07-11 15:13:15 +02:00
/**
2021-03-12 06:20:01 +01:00
* @return Collection
2020-07-11 15:13:15 +02:00
*/
2021-03-12 06:20:01 +01:00
public function get(): Collection;
2020-06-07 16:38:15 +02:00
2020-06-20 16:28:23 +02:00
/**
2022-12-29 19:42:26 +01:00
* @param ObjectGroup $objectGroup
2020-06-20 16:28:23 +02:00
*
* @return Collection
*/
2021-03-12 06:20:01 +01:00
public function getBills(ObjectGroup $objectGroup): Collection;
2020-06-20 16:28:23 +02:00
2021-03-06 15:00:34 +01:00
/**
2022-12-29 19:42:26 +01:00
* @param ObjectGroup $objectGroup
2021-03-06 15:00:34 +01:00
*
* @return Collection
*/
2021-03-12 06:20:01 +01:00
public function getPiggyBanks(ObjectGroup $objectGroup): Collection;
2021-03-06 15:00:34 +01:00
2021-03-21 09:15:40 +01:00
/**
* Delete all.
*/
public function resetOrder(): void;
2020-06-07 16:38:15 +02:00
/**
2022-12-29 19:42:26 +01:00
* @param string $query
* @param int $limit
2021-03-12 06:20:01 +01:00
*
* @return Collection
2020-06-07 16:38:15 +02:00
*/
2021-03-12 06:20:01 +01:00
public function search(string $query, int $limit): Collection;
2020-06-07 16:38:15 +02:00
2020-06-20 10:10:55 +02:00
/**
2022-12-29 19:42:26 +01:00
* @param ObjectGroup $objectGroup
* @param int $newOrder
2020-06-20 10:10:55 +02:00
*
* @return ObjectGroup
*/
2021-03-14 06:20:23 +01:00
public function setOrder(ObjectGroup $objectGroup, int $newOrder): ObjectGroup;
2021-03-12 06:20:01 +01:00
2021-04-05 21:52:55 +02:00
/**
2022-12-29 19:42:26 +01:00
* @param User $user
2021-04-05 21:52:55 +02:00
*/
public function setUser(User $user): void;
2020-06-20 10:10:55 +02:00
/**
2022-12-29 19:42:26 +01:00
* @param ObjectGroup $objectGroup
* @param array $data
2020-06-20 10:10:55 +02:00
*
* @return ObjectGroup
*/
public function update(ObjectGroup $objectGroup, array $data): ObjectGroup;
2020-06-07 11:31:01 +02:00
}