Need to "use" the TriggerFactory!

This commit is contained in:
James Cole 2016-02-17 15:46:58 +01:00
parent 0d44f82c86
commit 317aa591c3

View File

@ -10,6 +10,7 @@ declare(strict_types = 1);
namespace FireflyIII\Models; namespace FireflyIII\Models;
use FireflyIII\Rules\Triggers\TriggerFactory;
use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Model;
/** /**
@ -29,6 +30,15 @@ use Illuminate\Database\Eloquent\Model;
*/ */
class RuleTrigger extends 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 * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/ */
@ -36,12 +46,4 @@ class RuleTrigger extends Model
{ {
return $this->belongsTo('FireflyIII\Models\Rule'); 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();
}
} }