From 70e72c246d5a9eb93a9a4f03bf65c71bee9335f5 Mon Sep 17 00:00:00 2001 From: Robert Horlings Date: Wed, 17 Feb 2016 13:03:02 +0100 Subject: [PATCH] Added method to RuleTrigger object as well --- app/Models/RuleTrigger.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/Models/RuleTrigger.php b/app/Models/RuleTrigger.php index dc92048977..cf13c918d7 100644 --- a/app/Models/RuleTrigger.php +++ b/app/Models/RuleTrigger.php @@ -36,4 +36,12 @@ 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(); + } }