mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Remove triggers
This commit is contained in:
parent
ce56cc538d
commit
5a188ceca3
@ -122,25 +122,5 @@ class EventServiceProvider extends ServiceProvider
|
|||||||
protected function registerDeleteEvents()
|
protected function registerDeleteEvents()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
TransactionJournal::deleted(
|
|
||||||
function (TransactionJournal $journal) {
|
|
||||||
Log::debug(sprintf('Now triggered journal delete response #%d', $journal->id));
|
|
||||||
|
|
||||||
/** @var Transaction $transaction */
|
|
||||||
foreach ($journal->transactions()->get() as $transaction) {
|
|
||||||
Log::debug(sprintf('Will now delete transaction #%d', $transaction->id));
|
|
||||||
$transaction->delete();
|
|
||||||
}
|
|
||||||
|
|
||||||
// also delete journal_meta entries.
|
|
||||||
|
|
||||||
/** @var TransactionJournalMeta $meta */
|
|
||||||
foreach ($journal->transactionJournalMeta()->get() as $meta) {
|
|
||||||
Log::debug(sprintf('Will now delete meta-entry #%d', $meta->id));
|
|
||||||
$meta->delete();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user