Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

AccountCategoryDTO.php 659B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. namespace App\DTO;
  3. use Livewire\Wireable;
  4. class AccountCategoryDTO implements Wireable
  5. {
  6. /**
  7. * @param AccountDTO[] $accounts
  8. */
  9. public function __construct(
  10. public array $accounts,
  11. public AccountBalanceDTO $summary,
  12. ) {
  13. }
  14. public function toLivewire(): array
  15. {
  16. return [
  17. 'accounts' => $this->accounts,
  18. 'summary' => $this->summary->toLivewire(),
  19. ];
  20. }
  21. public static function fromLivewire($value): static
  22. {
  23. return new static(
  24. $value['accounts'],
  25. AccountBalanceDTO::fromLivewire($value['summary']),
  26. );
  27. }
  28. }