firefly-iii/app/Repositories/Rule/RuleRepositoryInterface.php

126 lines
2.3 KiB
PHP

<?php
declare(strict_types = 1);
/**
* 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;
use FireflyIII\Models\Rule;
use FireflyIII\Models\RuleAction;
use FireflyIII\Models\RuleGroup;
use FireflyIII\Models\RuleTrigger;
/**
* Interface RuleRepositoryInterface
*
* @package FireflyIII\Repositories\Rule
*/
interface RuleRepositoryInterface
{
/**
* @return int
*/
public function count();
/**
* @param Rule $rule
*
* @return bool
*/
public function destroy(Rule $rule);
/**
* @return RuleGroup
*/
public function getFirstRuleGroup();
/**
* @param RuleGroup $ruleGroup
*
* @return int
*/
public function getHighestOrderInRuleGroup(RuleGroup $ruleGroup);
/**
* @param Rule $rule
*
* @return string
*/
public function getPrimaryTrigger(Rule $rule): string;
/**
* @param Rule $rule
*
* @return bool
*/
public function moveDown(Rule $rule);
/**
* @param Rule $rule
*
* @return bool
*/
public function moveUp(Rule $rule);
/**
* @param Rule $rule
* @param array $ids
*
* @return bool
*/
public function reorderRuleActions(Rule $rule, array $ids);
/**
* @param Rule $rule
* @param array $ids
*
* @return bool
*/
public function reorderRuleTriggers(Rule $rule, array $ids);
/**
* @param RuleGroup $ruleGroup
*
* @return bool
*/
public function resetRulesInGroupOrder(RuleGroup $ruleGroup);
/**
* @param array $data
*
* @return Rule
*/
public function store(array $data);
/**
* @param Rule $rule
* @param array $values
*
* @return RuleAction
*/
public function storeAction(Rule $rule, array $values);
/**
* @param Rule $rule
* @param array $values
*
* @return RuleTrigger
*/
public function storeTrigger(Rule $rule, array $values);
/**
* @param Rule $rule
* @param array $data
*
* @return Rule
*/
public function update(Rule $rule, array $data);
}