. */ declare(strict_types=1); namespace FireflyIII\TransactionRules\Actions; use FireflyIII\Models\RuleAction; use FireflyIII\Models\TransactionJournal; use Log; /** * Class AppendDescription. */ class AppendDescription implements ActionInterface { /** @var RuleAction The rule action */ private $action; /** * TriggerInterface constructor. * * @param RuleAction $action */ public function __construct(RuleAction $action) { $this->action = $action; } /** * Append description with X * * @param TransactionJournal $journal * * @return bool */ public function act(TransactionJournal $journal): bool { Log::debug(sprintf('RuleAction AppendDescription appended "%s" to "%s".', $this->action->action_value, $journal->description)); $journal->description = $journal->description . $this->action->action_value; $journal->save(); return true; } }