mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-11-16 22:58:09 +00:00
Start testing new rule actions.
This commit is contained in:
@@ -27,7 +27,7 @@ use FireflyIII\Models\Note;
|
||||
use FireflyIII\Models\RuleAction;
|
||||
use FireflyIII\Models\TransactionJournal;
|
||||
use Log;
|
||||
|
||||
use DB;
|
||||
/**
|
||||
* Class ClearNotes.
|
||||
*/
|
||||
@@ -46,7 +46,8 @@ class ClearNotes implements ActionInterface
|
||||
* Remove notes
|
||||
*
|
||||
* @param TransactionJournal $journal
|
||||
*
|
||||
* @codeCoverageIgnore
|
||||
* @deprecated
|
||||
* @return bool
|
||||
* @throws Exception
|
||||
*/
|
||||
@@ -62,4 +63,17 @@ class ClearNotes implements ActionInterface
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function actOnArray(array $journal): bool
|
||||
{
|
||||
DB::table('notes')
|
||||
->where('noteable_id', $journal['transaction_journal_id'])
|
||||
->where('noteable_type', TransactionJournal::class)
|
||||
->delete();
|
||||
Log::debug(sprintf('RuleAction ClearNotes removed all notes.'));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user