Example #1
0
 /**
  * @param $data_store List_Data|array[]|object[]
  * @return List_Data|array[]|object[]|null
  */
 private function doFetch($data_store)
 {
     if ($this->class_name && !$data_store instanceof List_Data) {
         $this->object_builder = new Object_Builder_Array($this->class_name, false);
         $data_store = [];
     }
     $first = true;
     while ($result = $this->link->fetchRow($this->result_set)) {
         $row = $this->resultToRow($result, $first);
         if (!$this->store($row, $data_store)) {
             $stop = true;
             break;
         }
         $first = false;
     }
     if (!isset($stop)) {
         $this->doCallback($data_store);
     }
     return $this->callback ? null : $data_store;
 }