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.
|
- <?php
-
- namespace App\Repositories;
-
- use Illuminate\Support\Collection;
- use stdClass;
-
- class BaseRepositoryData extends stdClass
- {
- public function __construct(stdClass $data)
- {
- foreach ($data as $key => $val) {
- $this->$key = $val;
- }
- }
-
- /**
- * @param Collection<stdClass> $list
- * @return Collection<static>
- */
- static public function makeList(Collection $list)
- {
- $ret = collect();
- foreach ($list as $data) {
- $ret->push(new static($data));
- }
- return $ret;
- }
- }
|