示例#1
0
 /**
  * Executes the query and returns an array of corresponding DTOs
  *
  * @param object $sqlQuery
  * @return
  */
 protected function fetchRows($sqlQuery)
 {
     // Execute query.
     $res = $this->dbms->query($sqlQuery);
     $resultArr = array();
     if ($res && $this->dbms->getResultCount($res) > 0) {
         $results = $this->dbms->getResultArray($res);
         foreach ($results as $result) {
             $dto = $this->createDto();
             AbstractMapper::initializeDto($dto, $result);
             $resultArr[] = $dto;
         }
     }
     return $resultArr;
 }