mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-21 11:48:53 +00:00
Fix #3440
This commit is contained in:
@@ -483,4 +483,18 @@ class RuleRepository implements RuleRepositoryInterface
|
||||
|
||||
return $newRule;
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function moveRule(Rule $rule, RuleGroup $ruleGroup, int $order): Rule
|
||||
{
|
||||
$rule->order = $order;
|
||||
if ($rule->rule_group_id !== $ruleGroup->id) {
|
||||
$rule->rule_group_id = $ruleGroup->id;
|
||||
}
|
||||
$rule->save();
|
||||
|
||||
return $rule;
|
||||
}
|
||||
}
|
||||
|
@@ -39,6 +39,15 @@ interface RuleRepositoryInterface
|
||||
*/
|
||||
public function count(): int;
|
||||
|
||||
/**
|
||||
* @param Rule $rule
|
||||
* @param RuleGroup $ruleGroup
|
||||
* @param int $order
|
||||
*
|
||||
* @return Rule
|
||||
*/
|
||||
public function moveRule(Rule $rule, RuleGroup $ruleGroup, int $order): Rule;
|
||||
|
||||
/**
|
||||
* @param Rule $rule
|
||||
*
|
||||
|
Reference in New Issue
Block a user