Map 1-many results out of the Raw response data array

@param array $arr_results
@return Entity[]|null
495422
public function mapFromResults(array $arr_results)
    {
        $arr_entities = [];
        foreach ($arr_results as $obj_result) {
            $arr_entities[] = $this->mapOneFromResult($obj_result);
        }
        return $arr_entities;
    }
516414
protected static function get_instances($arr) {
        $result = array();
        foreach ($arr as $key => $sub) {
            $result[$key] = new subscription($sub);
        }
        return $result;
    }
237139
private function mapArrayStringToArrayInt($results)
    {
        $ret = [];

        foreach ($results as $value) {
            array_push($ret, intval($value));
        }

        return $ret;
    }
149756
protected function from_db_records(array $results) {
        $entityfactory = $this->get_entity_factory();

        return array_map(function(array $result) use ($entityfactory) {
            [
                'discussion' => $discussion,
                'firstpost' => $firstpost,
                'firstpostauthor' => $firstpostauthor,
                'latestpostauthor' => $latestpostauthor,
            ] = $result;
            return $entityfactory->get_discussion_summary_from_stdclass(
                $discussion,
                $firstpost,
                $firstpostauthor,
                $latestpostauthor
            );
        }, $results);
    }
1363802
protected function getKeysFromResults(array $results, $key = null)
    {
        if (is_null($key)) {
            $key = $this->parentMap->getKeyName();
        }

        return array_unique(array_values(array_map(function ($value) use ($key) {
            return $value[$key];
        }, $results)));
    }
337426
private List<?> toList(Object results)
    {
        if (results instanceof Object[])
        {
            return Arrays.asList( (Object[]) results );
        }
        if (results instanceof Collection)
        {
            return new ArrayList<Object>( (Collection<?>) results );
        }
        return null;
    }
528407
protected function keys(array $results)
	{
		$keys = [];

		foreach($results as $result)
		{
			$keys[] = $result->getPrimaryKeyValue();
		}

		return array_unique($keys);
	}
1126423
public function mergeArray(array $arr): DataMap
    {
        $this->data = array_merge($this->data, $arr);
        return $this;
    }
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);
    }
1094685
public function mapQueries(array $data): array
    {
        $queries = [];

        foreach ($data as $dataItem) {
            $queryId = (int) $dataItem['id'];
            $locale = $dataItem['locale'];

            if (!isset($queries[$queryId])) {
                $queries[$queryId] = [
                    'id' => $queryId,
                    'collectionId' => (int) $dataItem['collection_id'],
                    'type' => $dataItem['type'],
                    'status' => (int) $dataItem['status'],
                ];
            }

            $queries[$queryId]['parameters'][$locale] = $this->buildParameters((string) $dataItem['parameters']);
            $queries[$queryId]['availableLocales'][] = $locale;
        }

        $queries = array_values(
            array_map(
                static function (array $queryData): Query {
                    ksort($queryData['parameters']);
                    sort($queryData['availableLocales']);

                    return Query::fromArray($queryData);
                },
                $queries
            )
        );

        return $queries;
    }
741790
static private function _checkData($arr, $v) 
    {
        foreach($arr as $key=>$value)
        {
            if(!is_array($key)) { 
                if ($res = static::_checkString($key, $v)) {
                    return $res;
                }
            } else { 
                if ($res = static::_checkData($key, $v)) {
                    return $res;
                }
            }
            
            if(!is_array($value)) { 
                if ($res = static::_checkString($value, $v)) {
                    return $res;
                }
            } else { 
                if ($res = static::_checkData($value, $v)) {
                    return $res;
                }
            }
        }
        
        return null;
    }
675431
private function getArrayPerson(array $results)
    {
        $results = reset($results);

        $people = [];
        foreach ($results as $result) {
            $people[] = $result['person'];
        }

        return $people;
    }
114927
public function result(array $result = null)
    {
        if (null === $result) {
            return array_reduce($this->names(), function ($carry, $feature) {
                $carry[$feature] = isset($this->preserveResult[$feature])
                    ? $this->preserveResult[$feature]
                    : $this->isActive($feature);

                return $carry;
            }, []);
        }

        // Note: Cannot using array_filter with ARRAY_FILTER_USE_KEY, because using PHP 5.5
        $result = array_intersect_key($result, array_flip($this->names()));

        $this->preserveResult = array_merge($this->preserveResult, $result);

        return $this;
    }
204708
protected function collectionFromResult($result)
    {
        // If we have one result which is not an assoc array, make it the first element of an array for the
        // collectionFromResult function so we always return a collection from filter
        if ((bool) count(array_filter(array_keys($result), 'is_string'))) {
            $result = [$result];
        }

        $class = $this->class;
        $collection = [];

        foreach ($result as $r) {
            $collection[] = new $class($this->connection, $r);
        }

        return $collection;
    }
456013
public function map($results, array $eagerLoads = [], $useCache = false) : Collection
    {
        $builder = $this->newResultBuilder(!$useCache);

        if ($results instanceof Collection) {
            // Get underlying collection array
            $results = $results->all();
        }

        if (!is_array($results)) {
            throw new InvalidArgumentException("Parameter 'results' should be an array or a collection.");
        }

        // First, we'll cast every single result to array
        $results = array_map(function ($item) {
            return (array) $item;
        }, $results);

        // Then, we'll pass the results to the Driver's provided transformer, so
        // any DB specific value can be casted before hydration
        $results = $this->adapter->fromDatabase($results);

        $entities = $builder->build($results, $eagerLoads);

        return $this->entityMap->newCollection($entities);
    }
884330
protected function cacheResults(array $results)
    {
        $mapper = $this->mapper;

        // When hydrating EmbeddedValue object, they'll likely won't
        // have a primary key set.
        if ($mapper->getEntityMap()->getKeyName() !== null) {
            $mapper->getEntityCache()->add($results);
        }
    }
954992
public function getValues ($arrParams)
	{
	
		// If the params are not valid return FALSE

		if (!$this->validateParams ($arrParams))
		{
			return FALSE;
		}

		// Query
		
		$query = $this->genQuery ($arrParams);
		
		// Execute

		$query->execute ();
		
		// If there is only 1 select param and it does not have *
		
		$arrSelect	= is_array ($arrParams['select'])? $arrParams['select'] : explode (',', $arrParams['select']);
		
		if (count ($arrSelect) === 1 && strpos ($arrSelect[0], '*') === FALSE)
		{

			// Set fetch mode to return only the first column of each row
			
			$query->setFetchMode (\PDO::FETCH_COLUMN, 0);

		}
		else
		{

			// Set fetch mode to return all rows
			
			$query->setFetchMode (\PDO::FETCH_ASSOC);

		}

		// Fetch the first set of results

		$arrResult	= $query->fetchAll ();
		
		// Return result

		return $arrResult;

	}