Get all statistics as array.

@param \KmbPuppetDb\Query\Query|array $query
@return array
968229
public function getAllAsArray($query = null)
    {
        return [
            'skips' => $this->getSkipsCount($query),
            'success' => $this->getSuccessCount($query),
            'failures' => $this->getFailuresCount($query),
            'noops' => $this->getNoopsCount($query),
        ];
    }
967416
protected function getRecordByQuery($query)
    {
        return \OxidEsales\Eshop\Core\DatabaseProvider::getDb(\OxidEsales\Eshop\Core\DatabaseProvider::FETCH_MODE_ASSOC)->select($query);
    }
231813
private function extractSearchTerms(string $query): array
    {
        $search_terms = [];

        // Words in double quotes stay together
        while (preg_match('/"([^"]+)"/', $query, $match)) {
            $search_terms[] = trim($match[1]);
            $query          = str_replace($match[0], '', $query);
        }

        // Other words get treated separately
        while (preg_match('/[\S]+/', $query, $match)) {
            $search_terms[] = trim($match[0]);
            $query          = str_replace($match[0], '', $query);
        }

        return $search_terms;
    }
820065
public function query($query)
    {
        $statement = $this->db->prepare($query);
        $statement->execute($this->binds);

        $this->clear();

        $collection = array();

        while (false !== ($row = $statement->fetchObject())) {
            $collection[] = $this->newDataInstance($row, true);
        }

        return $collection;
    }
160178
public function findAll($query = null) {
        if ($query === null) {
            $mapping = $this->getMapping();
            $table = $this->escapeIdentifier($mapping['table']);
            $query = 'select * from '.$table;
        }
        return $this->getWorker()->findAll($query);
    }
300441
public function getSortColumns(array $query = [])
    {
        $current_sort_by = $this->getSortColumn($query);

        // sort by
        $sort_by = [];
        foreach (self::$sort_by_column as $column => $info) {
            $sort_by[] = [
                'name' => $info['name'],
                'title' => $info['title'],
                'current' => $current_sort_by == $column,
                'link' => '?'.http_build_query(
                    array_merge($query, ['sort_by' => $column])
                ),
            ];
        }

        return $sort_by;
    }
413071
final public function queryArray(string $query)
    {
        $result = $this->queryResult($query);
        if (false === $result) {
            return false;
        }

        $return = [];
        while (false !== $row = $result->fetchRow()) {
            $return[] = $row;
        }
        return $return;
    }
510540
protected function processMultipleResults($query)
    {
        if (!empty($this->fetchRefs)) {
            $models = [];
            foreach ($query->fetchAll() as $model) {
                $models[] = $this->populateModelFromJoin($model);
            }
        } else {
            $models = $query->fetchAllClass($this->modelClass);
        }
        if (isset($this->manager)) {
            foreach ($models as $model) {
                $this->manager->manageModel($model);
            }
        }
        $this->fetchReferences(false);
        return $models;
    }
79320
final protected function getHydratedObjects($query): array
    {
        $collection = new Collection($this, $query);

        $this->query->close($query);

        return $collection();
    }
407070
public static function isIndexedArray(array $query)
    {
        if (empty($query) || !isset($query[0])) {
            return false;
        }

        return array_keys($query) === range(0, count($query) - 1);
    }
649148
public static function aggregate($query)
    {
        $rows = self::connection()->aggregate(self::collectionName(), $query);
        return $rows;
    }
765520
public function query_array($query)
	{
        Eresus_Kernel::log(__METHOD__, LOG_NOTICE, 'This method is deprecated');
		$db = Eresus_DB::getHandler();
		$stmt = $db->prepare($query);
		if (!$stmt->execute())
		{
			return false;
		}

		$values = $stmt->fetchAll(PDO::FETCH_ASSOC);
		return $values;
	}
425137
public function allArray(Query $query = null) {
		$iterator = $this->getIterator();
		$array = $iterator->all($query);
		$array = $this->forgeEntity($array);
		return $array;
	}
720780
public function &getList($query)
    {
        $_result = array();
        $_ret = $this->execute($query);
        if ( $_ret != false ) {

            while ( ($_rows = $_ret->fetch(PDO::FETCH_ASSOC)) != false )
                $_result[]  = $_rows;
        }
        return $_result;
    }
330768
function queryColumn($query)
  {
    $data = [];
    $res = $this->q($query);
    while ($row = $res->fetch_row())
    {
      if ($res->field_count == 1)
        $data[] = $row[0];
      else
        $data[$row[0]] = $row[1];
    }
    $res->close();
    return $data;
  }
259960
protected function paramArrays(&$query, &$params)
    {
        if (!is_array($params)) {
            return;
        }

        $newParams = [];

        $this->modifyQuery($query, function ($part) use (&$params, &$newParams) {
            $newPart = "";
            $tmpPart = $part;

            while (count($params) > 0) {
                $pos = strpos($tmpPart, "?");
                if ($pos === false) {
                    break;
                }

                $val = array_shift($params);

                $newPart .= substr($tmpPart, 0, $pos);
                $tmpPart = substr($tmpPart, $pos + 1);

                # If this is just a straight value then don't do anything to it
                if (!is_array($val)) {
                    $newPart .= "?";
                    $newParams[] = $val;
                    continue;
                }

                # If the array is only 1 element (or no elements) long then convert it to an = (or <> for NOT IN)
                if (count($val) < 2) {
                    $newPart = preg_replace("/\s*\bNOT\s+IN\s*$/i", "<>", $newPart);
                    $newPart = preg_replace("/\s*\bIN\s*$/i", "=", $newPart);
                    $newPart .= "?";
                    $newParams[] = reset($val);
                    continue;
                }

                # Convert each element of the array to a separate marker
                $markers = [];
                foreach ($val as $v) {
                    $markers[] = "?";
                    $newParams[] = $v;
                }
                $newPart .= "(" . implode(",", $markers) . ")";
            }

            $newPart .= $tmpPart;

            return $newPart;
        });

        $params = $newParams;
    }
580378
public function query($query) {
    $dataConnection = $this->app->getDataConnection($this->connection);
    $foundObjects = $dataConnection->query($this->table, $query);
    $foundModels = array();
    foreach ($foundObjects as $foundObject) {
      /**
       * @var $model \MABI\Model
       */
      $model = call_user_func($this->modelClass . '::init', $this->app);
      $model->load($foundObject);
      $foundModels[] = $model;
    }
    return $foundModels;
  }