-
app/Handlers/Events/StoredAccountEventHandler.php
Open in GitHubuse FireflyIII\Events\StoredAccount; use FireflyIII\Services\Internal\Support\CreditRecalculateService; class StoredAccountEventHandler { public function recalculateCredit(StoredAccount $event): void { $account = $event->account; $object = app(CreditRecalculateService::class); $object->setAccount($account); $object->recalculate(); } }
-
app/Events/StoredAccount.php
Open in GitHubuse FireflyIII\Models\Account; use Illuminate\Queue\SerializesModels; class StoredAccount extends Event { use SerializesModels; public Account $account; public function __construct(Account $account) { $this->account = $account; } }
-
app/Providers/EventServiceProvider.php
Open in GitHubuse FireflyIII\Events\StoredAccount; use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider; class EventServiceProvider extends ServiceProvider { protected $listen = [ // StoredAccount::class => [ 'FireflyIII\Handlers\Events\StoredAccountEventHandler@recalculateCredit', ], // ]; // }
-
app/Factory/AccountFactory.php
Open in GitHubuse FireflyIII\Events\StoredAccount; use FireflyIII\Models\Account; class AccountFactory { // public function create(array $data): Account { $type = $this->getAccountType($data); $data['iban'] = $this->filterIban($data['iban'] ?? null); $return = $this->find($data['name'], $type->type); if (null !== $return) { return $return; } $return = $this->createAccount($type, $data); event(new StoredAccount($return)); return $return; } // }