Skip to content

Firefly III: a personal finances manager

Need to "use" the TriggerFactory!

James Cole317aa591c39c
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;
/**
@@ -30,18 +31,19 @@ use Illuminate\Database\Eloquent\Model;
class RuleTrigger extends Model
{
/**
- * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
+ * Checks whether this trigger will match all transactions
+ * For example: amount > 0 or description starts with ''
*/
- public function rule()
+ public function matchesAnything()
{
- return $this->belongsTo('FireflyIII\Models\Rule');
+ return TriggerFactory::getTrigger($this, new TransactionJournal)->matchesAnything();
}
-
+
/**
- * Checks whether this trigger will match all transactions
- * For example: amount > 0 or description starts with ''
+ * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
- public function matchesAnything() {
- return TriggerFactory::getTrigger($this, new TransactionJournal)->matchesAnything();
+ public function rule()
+ {
+ return $this->belongsTo('FireflyIII\Models\Rule');
}
}