protected function buildKeyedResultSet(array $results, string $primaryKey) : array
    {
        $builder = new EntityBuilder($this->mapper, array_keys($this->eagerLoads), $this->useCache);

        $keys = array_map(function ($item) use ($primaryKey) {
            return $item[$primaryKey];
        }, $results);

        return array_combine($keys, array_map(function ($item) use ($builder) {
            return $builder->build($item);
        }, $results));
    }