Move stuff to request classes for #339

This commit is contained in:
James Cole
2016-10-23 12:10:22 +02:00
parent 83f48418f6
commit 9a30fbd05a
15 changed files with 129 additions and 91 deletions

View File

@@ -79,6 +79,21 @@ class RuleGroupRepository implements RuleGroupRepositoryInterface
return true;
}
/**
* @param int $ruleGroupId
*
* @return RuleGroup
*/
public function find(int $ruleGroupId): RuleGroup
{
$group = $this->user->ruleGroups()->find($ruleGroupId);
if (is_null($group)) {
return new RuleGroup;
}
return $group;
}
/**
* @return Collection
*/

View File

@@ -42,6 +42,13 @@ interface RuleGroupRepositoryInterface
*/
public function destroy(RuleGroup $ruleGroup, RuleGroup $moveTo = null): bool;
/**
* @param int $ruleGroupId
*
* @return RuleGroup
*/
public function find(int $ruleGroupId): RuleGroup;
/**
* @return Collection
*/