您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

AccountCategoryDTO.php 654B

1234567891011121314151617181920212223242526272829303132
  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. public function toLivewire(): array
  14. {
  15. return [
  16. 'accounts' => $this->accounts,
  17. 'summary' => $this->summary->toLivewire(),
  18. ];
  19. }
  20. public static function fromLivewire($value): static
  21. {
  22. return new static(
  23. $value['accounts'],
  24. AccountBalanceDTO::fromLivewire($value['summary']),
  25. );
  26. }
  27. }