From 971874c197dd867889d6370daa9735300bb3603b Mon Sep 17 00:00:00 2001 From: ytake Date: Wed, 20 Sep 2017 01:36:24 +0900 Subject: [PATCH] bug fix --- src/QueryResult.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/QueryResult.php b/src/QueryResult.php index 8600722..629912a 100644 --- a/src/QueryResult.php +++ b/src/QueryResult.php @@ -156,9 +156,9 @@ public function yieldObject(string $fetchClassName) } $column = $this->getColumns(); $columnCount = count($column); - $reflectionClass = new \ReflectionClass($fetchClassName); - $newInstance = $reflectionClass->newInstanceWithoutConstructor(); foreach ($this->data as $data) { + $reflectionClass = new \ReflectionClass($fetchClassName); + $newInstance = $reflectionClass->newInstanceWithoutConstructor(); for ($i = 0; $i < $columnCount; $i++) { if ($reflectionClass->hasProperty($column[$i]->getName())) { $property = $reflectionClass->getProperty($column[$i]->getName());