/**
  * @param QueryInterface $query
  * @return array
  */
 public function fetch(QueryInterface $query)
 {
     $query->checkReplacements();
     $plainQuery = $query->getPlainQuery();
     list($parameters, $plainQuery) = $this->modifyParametersFromArrayToScalar($query->getParameters(), $plainQuery);
     return $this->connection->fetchAll($plainQuery, $parameters);
 }
 /**
  * @param QueryInterface $query
  * @return array
  */
 public function fetch(QueryInterface $query)
 {
     $query->checkReplacements();
     $executed = $this->execute($query);
     $data = $executed->fetchAll();
     if ($executed instanceof ResultCacheStatement) {
         $this->hitsContainer->addSave($query->getPlainQuery(), serialize($data));
     }
     if ($executed instanceof ArrayStatement) {
         $this->hitsContainer->addRead($query->getPlainQuery(), serialize($data));
     }
     $executed->closeCursor();
     return $data;
 }