2016-01-13 00:16:29 -06:00
|
|
|
<?php
|
|
|
|
/**
|
2016-05-20 05:27:31 -05:00
|
|
|
* ScanForBillsAfterStore.php
|
2016-04-01 09:44:46 -05:00
|
|
|
* Copyright (C) 2016 thegrumpydictator@gmail.com
|
2016-01-13 00:16:29 -06:00
|
|
|
*
|
|
|
|
* This software may be modified and distributed under the terms
|
|
|
|
* of the MIT license. See the LICENSE file for details.
|
|
|
|
*/
|
|
|
|
|
2016-05-20 05:27:31 -05:00
|
|
|
declare(strict_types = 1);
|
|
|
|
|
2016-01-13 00:16:29 -06:00
|
|
|
namespace FireflyIII\Handlers\Events;
|
|
|
|
|
|
|
|
use FireflyIII\Events\TransactionJournalStored;
|
2016-01-29 00:29:21 -06:00
|
|
|
use FireflyIII\Support\Events\BillScanner;
|
2016-01-13 00:16:29 -06:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Class RescanJournal
|
|
|
|
*
|
|
|
|
* @package FireflyIII\Handlers\Events
|
|
|
|
*/
|
|
|
|
class ScanForBillsAfterStore
|
|
|
|
{
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Scan a transaction journal for possible links to bills, right after storing.
|
|
|
|
*
|
|
|
|
* @param TransactionJournalStored $event
|
|
|
|
*
|
2016-02-18 00:21:48 -06:00
|
|
|
* @return bool
|
2016-01-13 00:16:29 -06:00
|
|
|
*/
|
2016-02-18 00:21:48 -06:00
|
|
|
public function handle(TransactionJournalStored $event): bool
|
2016-01-13 00:16:29 -06:00
|
|
|
{
|
|
|
|
$journal = $event->journal;
|
2016-01-29 00:29:21 -06:00
|
|
|
BillScanner::scan($journal);
|
2016-03-14 14:53:56 -05:00
|
|
|
|
2016-02-18 00:21:48 -06:00
|
|
|
return true;
|
2016-01-13 00:16:29 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|