protected function getQueryBuilderResult($qb, $count = null, $hydrate = true, array $fields = array(), $except = false)
    {
        $result = $qb->execute();

        if ($except) {
            foreach ($result as $key => $value) {
                foreach ($value as $field => $data) {
                    if (is_int($field)) {
                        $result[$key] = $data;

                        continue 2;
                    }
                }
            }
        }

        if ($hydrate) {
            $result = $this->hydrate((array) $result, $fields);
        }

        if ($count === 1) {
            $result = is_array($result) ? reset($result) : $result;
        }

        return $result;
    }