mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-29 18:20:01 +00:00
Rule actions no longer need to know the journal at construction time. This is easier.
This commit is contained in:
@@ -22,27 +22,27 @@ class SetDescription implements ActionInterface
|
||||
{
|
||||
|
||||
private $action;
|
||||
private $journal;
|
||||
|
||||
|
||||
/**
|
||||
* TriggerInterface constructor.
|
||||
*
|
||||
* @param RuleAction $action
|
||||
* @param TransactionJournal $journal
|
||||
*/
|
||||
public function __construct(RuleAction $action, TransactionJournal $journal)
|
||||
public function __construct(RuleAction $action)
|
||||
{
|
||||
$this->action = $action;
|
||||
$this->journal = $journal;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param TransactionJournal $journal
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function act()
|
||||
public function act(TransactionJournal $journal)
|
||||
{
|
||||
$this->journal->description = $this->action->action_value;
|
||||
$this->journal->save();
|
||||
$journal->description = $this->action->action_value;
|
||||
$journal->save();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
Reference in New Issue
Block a user