2016-01-15 04:16:41 -06:00
|
|
|
<?php
|
2016-02-05 05:08:25 -06:00
|
|
|
declare(strict_types = 1);
|
2016-01-15 04:16:41 -06:00
|
|
|
|
|
|
|
namespace FireflyIII\Repositories\RuleGroup;
|
|
|
|
|
|
|
|
|
2016-01-15 04:27:27 -06:00
|
|
|
use FireflyIII\Models\RuleGroup;
|
2016-02-17 10:27:41 -06:00
|
|
|
use FireflyIII\User;
|
2016-01-15 04:27:27 -06:00
|
|
|
use Illuminate\Support\Collection;
|
|
|
|
|
2016-01-15 06:13:21 -06:00
|
|
|
/**
|
|
|
|
* Interface RuleGroupRepositoryInterface
|
|
|
|
*
|
|
|
|
* @package FireflyIII\Repositories\RuleGroup
|
|
|
|
*/
|
2016-01-15 04:27:27 -06:00
|
|
|
interface RuleGroupRepositoryInterface
|
2016-01-15 04:16:41 -06:00
|
|
|
{
|
2016-02-17 10:27:41 -06:00
|
|
|
|
|
|
|
|
2016-01-24 09:50:55 -06:00
|
|
|
/**
|
|
|
|
* @return int
|
|
|
|
*/
|
|
|
|
public function count();
|
|
|
|
|
2016-01-15 04:27:27 -06:00
|
|
|
/**
|
|
|
|
* @param RuleGroup $ruleGroup
|
|
|
|
* @param RuleGroup $moveTo
|
|
|
|
*
|
|
|
|
* @return bool
|
|
|
|
*/
|
2016-01-15 06:13:21 -06:00
|
|
|
public function destroy(RuleGroup $ruleGroup, RuleGroup $moveTo = null);
|
2016-01-15 04:27:27 -06:00
|
|
|
|
|
|
|
/**
|
2016-01-19 06:59:54 -06:00
|
|
|
* @return Collection
|
2016-01-15 04:27:27 -06:00
|
|
|
*/
|
2016-01-19 06:59:54 -06:00
|
|
|
public function get();
|
2016-01-15 04:27:27 -06:00
|
|
|
|
|
|
|
/**
|
2016-01-19 06:59:54 -06:00
|
|
|
* @return int
|
2016-01-15 04:27:27 -06:00
|
|
|
*/
|
2016-01-19 06:59:54 -06:00
|
|
|
public function getHighestOrderRuleGroup();
|
2016-01-15 04:27:27 -06:00
|
|
|
|
2016-02-17 10:27:41 -06:00
|
|
|
/**
|
|
|
|
* @param User $user
|
|
|
|
*
|
|
|
|
* @return Collection
|
|
|
|
*/
|
|
|
|
public function getRuleGroupsWithRules(User $user): Collection;
|
|
|
|
|
2016-01-15 04:27:27 -06:00
|
|
|
/**
|
|
|
|
* @param RuleGroup $ruleGroup
|
2016-01-15 06:13:21 -06:00
|
|
|
*
|
2016-01-15 04:27:27 -06:00
|
|
|
* @return bool
|
|
|
|
*/
|
2016-01-19 06:59:54 -06:00
|
|
|
public function moveDown(RuleGroup $ruleGroup);
|
2016-01-15 04:27:27 -06:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @param RuleGroup $ruleGroup
|
2016-01-15 06:13:21 -06:00
|
|
|
*
|
2016-01-15 04:27:27 -06:00
|
|
|
* @return bool
|
|
|
|
*/
|
2016-01-19 06:59:54 -06:00
|
|
|
public function moveUp(RuleGroup $ruleGroup);
|
2016-01-15 04:27:27 -06:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @return bool
|
|
|
|
*/
|
|
|
|
public function resetRuleGroupOrder();
|
|
|
|
|
|
|
|
/**
|
2016-01-15 10:38:09 -06:00
|
|
|
* @param RuleGroup $ruleGroup
|
|
|
|
*
|
2016-01-15 04:27:27 -06:00
|
|
|
* @return bool
|
|
|
|
*/
|
|
|
|
public function resetRulesInGroupOrder(RuleGroup $ruleGroup);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param array $data
|
|
|
|
*
|
|
|
|
* @return RuleGroup
|
|
|
|
*/
|
2016-01-15 06:13:21 -06:00
|
|
|
public function store(array $data);
|
2016-01-15 04:27:27 -06:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @param RuleGroup $ruleGroup
|
|
|
|
* @param array $data
|
|
|
|
*
|
|
|
|
* @return RuleGroup
|
|
|
|
*/
|
2016-01-15 06:13:21 -06:00
|
|
|
public function update(RuleGroup $ruleGroup, array $data);
|
2016-01-15 04:27:27 -06:00
|
|
|
|
2016-01-15 04:16:41 -06:00
|
|
|
|
2016-01-28 14:50:20 -06:00
|
|
|
}
|