. */ declare(strict_types=1); namespace FireflyIII\Events; use FireflyIII\Models\PiggyBank; use FireflyIII\Models\TransactionGroup; use FireflyIII\Models\TransactionJournal; use Illuminate\Queue\SerializesModels; use Illuminate\Support\Facades\Log; /** * Class ChangedPiggyBankAmount */ class ChangedPiggyBankAmount extends Event { use SerializesModels; public string $amount; public PiggyBank $piggyBank; public ?TransactionGroup $transactionGroup; public ?TransactionJournal $transactionJournal; /** * Create a new event instance. * * @param PiggyBank $piggyBank * @param string $amount * @param TransactionJournal|null $transactionJournal * @param TransactionGroup|null $transactionGroup */ public function __construct(PiggyBank $piggyBank, string $amount, ?TransactionJournal $transactionJournal, ?TransactionGroup $transactionGroup) { Log::debug(sprintf('Created piggy bank event for piggy bank #%d with amount %s', $piggyBank->id, $amount)); $this->piggyBank = $piggyBank; $this->transactionJournal = $transactionJournal; $this->transactionGroup = $transactionGroup; $this->amount = $amount; } }