mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2024-12-28 01:41:14 -06:00
Need to "use" the TriggerFactory!
This commit is contained in:
parent
0d44f82c86
commit
317aa591c3
@ -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();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user