Browse Source

batch query result use ::model

alexlcdee 7 years ago
parent
commit
5c92a5fa84
1 changed files with 3 additions and 1 deletions
  1. 3 1
      src/components/BatchQueryResult.php

+ 3 - 1
src/components/BatchQueryResult.php

@@ -128,8 +128,10 @@ class BatchQueryResult implements \Iterator, \Countable
         $criteria->offset = $this->offset;
         $criteria->offset = $this->offset;
         $this->offset += $this->batchSize;
         $this->offset += $this->batchSize;
 
 
+        /** @var ActiveRecord $className */
         $className = get_class($this->ar);
         $className = get_class($this->ar);
-        return (new $className)->findAll($criteria);
+
+        return $className::model()->findAll($criteria);
     }
     }
 
 
     /**
     /**