Merge remote-tracking branch 'upstream/main' into feat/expression-engine

This commit is contained in:
Michael Thomas
2024-03-06 21:38:40 -05:00
2225 changed files with 111169 additions and 148980 deletions

View File

@@ -24,7 +24,6 @@ declare(strict_types=1);
namespace FireflyIII\TransactionRules\Actions;
use DB;
use FireflyIII\Events\TriggeredAuditLog;
use FireflyIII\Models\RuleAction;
use FireflyIII\Models\TransactionJournal;
@@ -40,8 +39,6 @@ class PrependDescription implements ActionInterface
/**
* TriggerInterface constructor.
*
* @param RuleAction $action
*/
public function __construct(RuleAction $action, ActionExpressionEvaluator $evaluator)
{
@@ -49,16 +46,13 @@ class PrependDescription implements ActionInterface
$this->evaluator = $evaluator;
}
/**
* @inheritDoc
*/
public function actOnArray(array $journal): bool
{
$actionValue = $this->evaluator->evaluate($journal);
$before = $journal['description'];
$after = sprintf('%s%s', $actionValue, $journal['description']);
DB::table('transaction_journals')->where('id', $journal['transaction_journal_id'])->limit(1)->update(['description' => $after]);
\DB::table('transaction_journals')->where('id', $journal['transaction_journal_id'])->limit(1)->update(['description' => $after]);
// journal
/** @var TransactionJournal $object */