2016-01-13 18:34:56 +01:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* RuleRepositoryInterface.php
|
|
|
|
* Copyright (C) 2016 Sander Dorigo
|
|
|
|
*
|
|
|
|
* This software may be modified and distributed under the terms
|
|
|
|
* of the MIT license. See the LICENSE file for details.
|
|
|
|
*/
|
|
|
|
|
|
|
|
namespace FireflyIII\Repositories\Rule;
|
|
|
|
|
2016-01-14 09:38:48 +01:00
|
|
|
use FireflyIII\Models\Rule;
|
2016-01-14 21:34:17 +01:00
|
|
|
use FireflyIII\Models\RuleAction;
|
2016-01-13 18:34:56 +01:00
|
|
|
use FireflyIII\Models\RuleGroup;
|
2016-01-14 21:34:17 +01:00
|
|
|
use FireflyIII\Models\RuleTrigger;
|
2016-01-13 18:34:56 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Interface RuleRepositoryInterface
|
|
|
|
*
|
|
|
|
* @package FireflyIII\Repositories\Rule
|
|
|
|
*/
|
|
|
|
interface RuleRepositoryInterface
|
|
|
|
{
|
|
|
|
/**
|
2016-01-15 11:27:27 +01:00
|
|
|
* @param Rule $rule
|
2016-01-13 21:44:26 +01:00
|
|
|
*
|
2016-01-14 21:34:17 +01:00
|
|
|
* @return bool
|
2016-01-13 21:44:26 +01:00
|
|
|
*/
|
2016-01-15 13:13:33 +01:00
|
|
|
public function destroy(Rule $rule);
|
2016-01-13 21:44:26 +01:00
|
|
|
|
2016-01-14 21:34:17 +01:00
|
|
|
/**
|
2016-01-15 11:27:27 +01:00
|
|
|
* @param RuleGroup $ruleGroup
|
2016-01-14 21:34:17 +01:00
|
|
|
*
|
2016-01-15 11:27:27 +01:00
|
|
|
* @return int
|
2016-01-14 21:34:17 +01:00
|
|
|
*/
|
2016-01-15 11:27:27 +01:00
|
|
|
public function getHighestOrderInRuleGroup(RuleGroup $ruleGroup);
|
2016-01-14 21:34:17 +01:00
|
|
|
|
2016-01-14 11:27:15 +01:00
|
|
|
/**
|
2016-01-15 09:25:32 +01:00
|
|
|
* @param Rule $rule
|
2016-01-14 11:27:15 +01:00
|
|
|
* @param array $ids
|
2016-01-15 13:13:33 +01:00
|
|
|
*
|
2016-01-14 11:27:15 +01:00
|
|
|
* @return bool
|
|
|
|
*/
|
|
|
|
public function reorderRuleTriggers(Rule $rule, array $ids);
|
|
|
|
|
|
|
|
/**
|
2016-01-15 09:25:32 +01:00
|
|
|
* @param Rule $rule
|
2016-01-14 11:27:15 +01:00
|
|
|
* @param array $ids
|
2016-01-15 13:13:33 +01:00
|
|
|
*
|
2016-01-14 11:27:15 +01:00
|
|
|
* @return bool
|
|
|
|
*/
|
|
|
|
public function reorderRuleActions(Rule $rule, array $ids);
|
|
|
|
|
2016-01-13 21:44:26 +01:00
|
|
|
/**
|
2016-01-15 11:27:27 +01:00
|
|
|
* @param RuleGroup $ruleGroup
|
2016-01-15 13:13:33 +01:00
|
|
|
*
|
2016-01-14 09:38:48 +01:00
|
|
|
* @return bool
|
|
|
|
*/
|
|
|
|
public function resetRulesInGroupOrder(RuleGroup $ruleGroup);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param Rule $rule
|
2016-01-15 13:13:33 +01:00
|
|
|
*
|
2016-01-14 09:38:48 +01:00
|
|
|
* @return bool
|
|
|
|
*/
|
2016-01-15 13:13:33 +01:00
|
|
|
public function moveUp(Rule $rule);
|
2016-01-14 09:38:48 +01:00
|
|
|
|
2016-01-15 09:25:32 +01:00
|
|
|
/**
|
|
|
|
* @param Rule $rule
|
|
|
|
* @param array $data
|
2016-01-15 13:13:33 +01:00
|
|
|
*
|
2016-01-15 09:25:32 +01:00
|
|
|
* @return Rule
|
|
|
|
*/
|
2016-01-15 13:13:33 +01:00
|
|
|
public function update(Rule $rule, array $data);
|
2016-01-15 09:25:32 +01:00
|
|
|
|
2016-01-14 09:38:48 +01:00
|
|
|
/**
|
|
|
|
* @param Rule $rule
|
2016-01-15 13:13:33 +01:00
|
|
|
*
|
2016-01-14 09:38:48 +01:00
|
|
|
* @return bool
|
|
|
|
*/
|
2016-01-15 13:13:33 +01:00
|
|
|
public function moveDown(Rule $rule);
|
2016-01-14 09:38:48 +01:00
|
|
|
|
2016-01-14 21:34:17 +01:00
|
|
|
/**
|
|
|
|
* @param array $data
|
|
|
|
*
|
|
|
|
* @return Rule
|
|
|
|
*/
|
2016-01-15 13:13:33 +01:00
|
|
|
public function store(array $data);
|
2016-01-14 21:34:17 +01:00
|
|
|
|
|
|
|
/**
|
2016-01-15 09:25:32 +01:00
|
|
|
* @param Rule $rule
|
2016-01-14 21:34:17 +01:00
|
|
|
* @param string $action
|
|
|
|
* @param string $value
|
2016-01-15 09:25:32 +01:00
|
|
|
* @param bool $stopProcessing
|
|
|
|
* @param int $order
|
2016-01-14 21:34:17 +01:00
|
|
|
*
|
|
|
|
* @return RuleTrigger
|
|
|
|
*/
|
|
|
|
public function storeTrigger(Rule $rule, $action, $value, $stopProcessing, $order);
|
|
|
|
|
|
|
|
/**
|
2016-01-15 09:25:32 +01:00
|
|
|
* @param Rule $rule
|
2016-01-14 21:34:17 +01:00
|
|
|
* @param string $action
|
|
|
|
* @param string $value
|
2016-01-15 09:25:32 +01:00
|
|
|
* @param bool $stopProcessing
|
|
|
|
* @param int $order
|
2016-01-14 21:34:17 +01:00
|
|
|
*
|
|
|
|
* @return RuleAction
|
|
|
|
*/
|
|
|
|
public function storeAction(Rule $rule, $action, $value, $stopProcessing, $order);
|
|
|
|
|
2016-01-13 18:34:56 +01:00
|
|
|
}
|