system/classes/Gateway.php
public function fetchByQuery($query)
	{
    if (!$query->isSelectSet()) {
      $query->select('*');
    }
    $query->from($this->tableName);
    
    if ($this->viewQuery) {
      echo $query->getQuery();
    }

    return $query->fetchAll();
	}
public function fetchByQuery($query)
	{
    if (!$query->isSelectSet()) {
      $query->select('*');
    }
    $query->from($this->tableName);
    
    if ($this->viewQuery) {
      echo $query->getQuery();
    }

    return $query->fetchAll();
	}
$query is an instance of a Cora database.