領収証発行サービス
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
569B

  1. <?php
  2. namespace App\Repositories;
  3. use Illuminate\Support\Collection;
  4. use stdClass;
  5. class BaseRepositoryData extends stdClass
  6. {
  7. public function __construct(stdClass $data)
  8. {
  9. foreach ($data as $key => $val) {
  10. $this->$key = $val;
  11. }
  12. }
  13. /**
  14. * @param Collection<stdClass> $list
  15. * @return Collection<static>
  16. */
  17. static public function makeList(Collection $list)
  18. {
  19. $ret = collect();
  20. foreach ($list as $data) {
  21. $ret->push(new static($data));
  22. }
  23. return $ret;
  24. }
  25. }