mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Fix filters and other methods that used deprecated methods.
This commit is contained in:
@@ -10,6 +10,7 @@ declare(strict_types = 1);
|
||||
|
||||
namespace FireflyIII\Rules\Triggers;
|
||||
|
||||
use FireflyIII\Models\Account;
|
||||
use FireflyIII\Models\TransactionJournal;
|
||||
|
||||
/**
|
||||
@@ -52,9 +53,15 @@ final class ToAccountContains extends AbstractTrigger implements TriggerInterfac
|
||||
*/
|
||||
public function triggered(TransactionJournal $journal): bool
|
||||
{
|
||||
$toAccountName = strtolower($journal->destination_account_name ?? TransactionJournal::destinationAccount($journal)->name);
|
||||
$search = strtolower($this->triggerValue);
|
||||
$strpos = strpos($toAccountName, $search);
|
||||
$toAccountName = '';
|
||||
|
||||
/** @var Account $account */
|
||||
foreach (TransactionJournal::destinationAccountList($journal) as $account) {
|
||||
$toAccountName .= strtolower($account->name);
|
||||
}
|
||||
|
||||
$search = strtolower($this->triggerValue);
|
||||
$strpos = strpos($toAccountName, $search);
|
||||
|
||||
if (!($strpos === false)) {
|
||||
return true;
|
||||
|
Reference in New Issue
Block a user