| @@ 546-557 (lines=12) @@ | ||
| 543 | ||
| 544 | $propertyAccessor = PropertyAccess::createPropertyAccessor(); |
|
| 545 | /** @noinspection PhpAssignmentInConditionInspection */ |
|
| 546 | while ($row = $this->fetch_assoc()) { |
|
| 547 | $classTmp = clone $classTmpOrig; |
|
| 548 | $row = $this->cast($row); |
|
| 549 | foreach ($row as $key => $value) { |
|
| 550 | if ($class === '\stdClass') { |
|
| 551 | $classTmp->{$key} = $value; |
|
| 552 | } else { |
|
| 553 | $propertyAccessor->setValue($classTmp, $key, $value); |
|
| 554 | } |
|
| 555 | } |
|
| 556 | $data[] = $classTmp; |
|
| 557 | } |
|
| 558 | ||
| 559 | return $data; |
|
| 560 | } |
|
| @@ 610-621 (lines=12) @@ | ||
| 607 | ||
| 608 | $propertyAccessor = PropertyAccess::createPropertyAccessor(); |
|
| 609 | /** @noinspection PhpAssignmentInConditionInspection */ |
|
| 610 | while ($row = $this->fetch_assoc()) { |
|
| 611 | $classTmp = clone $classTmpOrig; |
|
| 612 | $row = $this->cast($row); |
|
| 613 | foreach ($row as $key => $value) { |
|
| 614 | if ($class === '\stdClass') { |
|
| 615 | $classTmp->{$key} = $value; |
|
| 616 | } else { |
|
| 617 | $propertyAccessor->setValue($classTmp, $key, $value); |
|
| 618 | } |
|
| 619 | } |
|
| 620 | ||
| 621 | yield $classTmp; |
|
| 622 | } |
|
| 623 | } |
|
| 624 | ||