From 317aa591c39cd1bd180953ce1dca5ee6463e319e Mon Sep 17 00:00:00 2001 From: James Cole Date: Wed, 17 Feb 2016 15:46:58 +0100 Subject: [PATCH] Need to "use" the TriggerFactory! --- app/Models/RuleTrigger.php | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/app/Models/RuleTrigger.php b/app/Models/RuleTrigger.php index cf13c918d7..365e873722 100644 --- a/app/Models/RuleTrigger.php +++ b/app/Models/RuleTrigger.php @@ -10,6 +10,7 @@ declare(strict_types = 1); namespace FireflyIII\Models; +use FireflyIII\Rules\Triggers\TriggerFactory; use Illuminate\Database\Eloquent\Model; /** @@ -29,6 +30,15 @@ use Illuminate\Database\Eloquent\Model; */ class RuleTrigger extends Model { + /** + * Checks whether this trigger will match all transactions + * For example: amount > 0 or description starts with '' + */ + public function matchesAnything() + { + return TriggerFactory::getTrigger($this, new TransactionJournal)->matchesAnything(); + } + /** * @return \Illuminate\Database\Eloquent\Relations\BelongsTo */ @@ -36,12 +46,4 @@ class RuleTrigger extends Model { return $this->belongsTo('FireflyIII\Models\Rule'); } - - /** - * Checks whether this trigger will match all transactions - * For example: amount > 0 or description starts with '' - */ - public function matchesAnything() { - return TriggerFactory::getTrigger($this, new TransactionJournal)->matchesAnything(); - } }