Build a dictionary with the entities.

@param array $results

@return void
437099
protected function buildDictionary($results)
    {
        foreach ($results as $result) {
            if ($result[$this->morphType]) {
                $this->dictionary[$result[$this->morphType]][$result[$this->foreignKey]][] = $result;
            }
        }
    }
786494
protected function from_db_records(array $results) {
        $entityfactory = $this->get_entity_factory();
        $records = array_map(function($result) {
            return $result['record'];
        }, $results);

        return $entityfactory->get_post_read_receipt_collection_from_stdclasses($records);
    }
721191
private static function convertResult($result)
    {
        if (!is_array($result)) {
            return self::convert($result);
        }

        $results = [];

        foreach ($result as $item) {
            $results[] = self::convert($item);
        }

        return $results;
    }
117868
def _build_dictionary(self, results):
        
        foreign = self._foreign_key

        dictionary = {}

        for result in results:
            key = getattr(result.pivot, foreign)
            if key not in dictionary:
                dictionary[key] = []

            dictionary[key].append(result)

        return dictionary
1329662
public function formatAutocompleteResponse($results)
    {
        $output = [];
        foreach ($results as $row) {

            // Only keep the id and title fields
            $item = new stdClass;
            $item->id = $row->getKey();
            $item->title = $row->getAdminTitleAttribute();

            // Add properties for the columns mentioned in the list view within the
            // 'columns' property of this row in the response.  Use the same logic
            // found in Decoy::renderListColumn();
            $item->columns = [];
            foreach ($this->columns() as $column) {
                if (method_exists($row, $column)) {
                    $item->columns[$column] = call_user_func([$row, $column]);
                } elseif (isset($row->$column)) {
                    if (is_a($row->$column, 'Carbon\Carbon')) {
                        $item->columns[$column] = $row->$column->format(FORMAT_DATE);
                    } else {
                        $item->columns[$column] = $row->$column;
                    }
                } else {
                    $item->columns[$column] = null;
                }
            }

            // Add the item to the output
            $output[] = $item;
        }

        return $output;
    }
1223902
private function getFormattedResults(&$results) {
    return implode('', array(
        $this->getReportInfo($results),
        $this->getPaginationInfo($results),
        $this->getProfileInformation($results),
        $this->getQueryParameters($results),
        $this->getColumnHeaders($results),
        $this->getTotalsForAllResults($results),
        $this->getRows($results)
    ));
    
  }
909250
private function process(Statement $results)
    {
        return $this->manager
            ->getResultProcessor()
            ->processRecords(
                $this->entity,
                $this->with,
                $this->fetchResults(
                    $results,
                    $this->entity->getPrimaryKey()
                ),
                $this->readOnly
            );
    }
362012
public function addEagerConstraints(array $results)
    {
        $table = $this->parentMap->getTable();

        $this->query->whereIn($table.'.'.$this->firstKey, $this->getKeysFromResults($results));
    }
588070
protected function from_db_records(array $results) : array {
        $entityfactory = $this->get_entity_factory();

        return array_map(function(array $result) use ($entityfactory) {
            [
                'forum' => $forumrecord,
                'course_module' => $coursemodule,
                'course' => $course,
                'context' => $context,
            ] = $result;
            return $entityfactory->get_forum_from_stdclass($forumrecord, $context, $coursemodule, $course);
        }, $results);
    }
495422
public function mapFromResults(array $arr_results)
    {
        $arr_entities = [];
        foreach ($arr_results as $obj_result) {
            $arr_entities[] = $this->mapOneFromResult($obj_result);
        }
        return $arr_entities;
    }
176052
public function buildResult($result)
    {
        $chatMembers = [];

        foreach ($result as $item) {
            $chatMembers[] = new ChatMember($item);
        }

        return $chatMembers;
    }
198298
protected function buildDictionary(Collection $results)
	{
		$dictionary = array();

		$foreign = $this->farParent->getForeignKey();

		// First we will create a dictionary of models keyed by the foreign key of the
		// relationship as this will allow us to quickly access all of the related
		// models without having to do nested looping which will be quite slow.
		foreach ($results as $result)
		{
			$dictionary[$result->{$foreign}][] = $result;
		}

		return $dictionary;
	}
1076486
protected function buildUnkeyedResultSet(array $results) : array
    {
        $builder = new EntityBuilder($this->mapper, array_keys($this->eagerLoads), $this->useCache);

        return array_map(function ($item) use ($builder) {
            return $builder->build($item);
        }, $results);
    }
883419
public function buildTree($results)
    {
        if (!count($results)) {
            return;
        }

        $root = $results[0];
        $root->buildTree($results);

        return $root;
    }
15809
private function getColumnHeaders(&$results) {
    $html = '<h3>Column Headers</h3><pre>';

    $headers = $results->getColumnHeaders();
    foreach ($headers as $header) {
      $html .= <<<HTML

Column Name = {$header->getName()}
Column Type = {$header->getColumnType()}
Data Type   = {$header->getDataType()}

HTML;
    }

    $html .= '</pre>';
    return $html;
  }
527274
protected function storeTags($results)
    {
        $this->table('telescope_entries_tags')->insert($results->flatMap(function ($tags, $uuid) {
            return collect($tags)->map(function ($tag) use ($uuid) {
                return [
                    'entry_uuid' => $uuid,
                    'tag' => $tag,
                ];
            });
        })->all());
    }
390255
public function parseResults($results): Fluent
    {
        $parsed = [];
        $lines = explode("\n", $results);

        foreach ($lines as $line) {
            if (empty($line)) {
                continue;
            }

            $line = explode(':', $line, 2);
            $parsed[$line[0]] = $line[1];
        }

        return new Fluent($parsed);
    }