@param array $result

@return ChatMember[]
176052
public function buildResult($result)
    {
        $chatMembers = [];

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

        return $chatMembers;
    }
748213
protected function _makeResult(array $result) {
        return Result::make($result, $this->getClient())->setModelClass($this->_fullModelClass());
    }
233019
public function members() : array
    {
        $members = [];

        if (!isset($this->info()->threadMembers) || $this->info()->threadMembers <= 0) return null;

        foreach ($this->info()->threadMembers as $member) {
            $members[] = new User($this->client, $member->onlineId);
        }

        return $members;
    }
595239
public static function keyPair(array $result): array
    {
        $firstRow = current($result);
        if (empty($firstRow)) {
            return $result;
        }

        list($keyName, $valueName) = array_keys($firstRow);

        return array_combine(
            array_column($result, $keyName),
            array_column($result, $valueName)
        );
    }
367331
public function my_getSubMembers($topic)
    {
        $array = $this->th_getSubMembers($topic);
        foreach ($this->client as $client) {
            $token = $client->getSubMembers($topic);
            $one_array = $client->getTokenResult($token);
            $array = array_merge($array, $one_array);
        }
        return $array;
    }
1297207
protected function getEagerModelKeys(array $results)
    {
        $keys = [];

        // First we need to gather all of the keys from the result set so we know what
        // to query for via the eager loading query. We will add them to an array then
        // execute a "where in" statement to gather up all of those related records.
        foreach ($results as $result) {
            if (array_key_exists($this->foreignKey, $result) && !is_null($value = $result[$this->foreignKey])) {
                $keys[] = $value;
            }
        }

        // If there are no keys that were not null we will just return an array with 0 in
        // it so the query doesn't fail, but will not return any results, which should
        // be what this developer is expecting in a case where this happens to them.
        if (count($keys) == 0) {
            return [0];
        }

        return array_values(array_unique($keys));
    }
1243122
private function comList($result)
    {
        foreach ($result as $res) {
            $data[$res->get('id')]['title'] = $res->get('title');
            $data[$res->get('id')]['resume'] = $res->get('resume');
            $data[$res->get('id')]['author'] = $res->get('author');
            $data[$res->get('id')]['autor'] = $res->get('autor');
            $data[$res->get('id')]['category'] = $res->get('category');
            $data[$res->get('id')]['categoria'] = $res->get('categoria');
            $data[$res->get('id')]['link'] = $res->get('link');
            $data[$res->get('id')]['pubdate'] = $res->get('pubdate');
            //$data[$res->get('id')]['image'] = ['type'=>'picture', 'src'=>'/media/blog.png'];

            $media = json_decode($res->get('media'));

            foreach ($media as $img) {
                if (isset($img->type) && $img->type == 'image') {
                    $data[$res->get('id')]['image'] = '/media/article/'.$res->get('id').'/mini_'.basename($img->src);
                    break;
                }

                if (isset($img->type) && $img->type == 'video') {
                    $data[$res->get('id')]['image'] = '/media/v.png';
                }
            }
        }
    
        return $data;
    }
233869
protected function _messages(ResultSetInterface $results)
    {
        if (!$results->count()) {
            return [];
        }

        $messages = [];
        $pluralForms = 0;
        $item = $results->first();
        // There are max 6 plural forms possible but most people won't need
        // that so will only have the required number of value_{n} fields in db.
        for ($i = 5; $i > 0; $i--) {
            if (isset($item['value_' . $i])) {
                $pluralForms = $i;
                break;
            }
        }

        foreach ($results as $item) {
            $singular = $item['singular'];
            $context = $item['context'];
            $translation = $item['value_0'];
            if ($context) {
                $messages[$singular]['_context'][$context] = $item['value_0'];
            } else {
                $messages[$singular] = $item['value_0'];
            }

            if (empty($item['plural'])) {
                continue;
            }

            $key = $item['plural'];
            $plurals = [];
            for ($i = 0; $i <= $pluralForms; $i++) {
                $plurals[] = $item['value_' . $i];
            }

            if ($context) {
                $messages[$key]['_context'][$context] = $plurals;
            } else {
                $messages[$key] = $plurals;
            }
        }

        return $messages;
    }
1213690
private function makeOptions(array $result)
    {
        $options = (null !== $this->options['default_option']) ? [0 => $this->options['default_option']] : [];
        
        foreach ($result as $row) {
            $this->makeOption($row, $options);
        }
        
        return $options;
    }
179781
private function getErrorMessage(array $result)
    {
        $errorMessage = '';
        if (isset($result['errors'][0]['property']) && isset($result['errors'][0]['message'])) {
            $errorMessage = $result['errors'][0]['property'] . ': ' . $result['errors'][0]['message'];
        }
        return $errorMessage;
    }
1364771
protected function handleResult(array $result)
    {
        if ($this->onlyCount && isset($result[0]) && is_array($result[0])) {
            return (int)current($result[0]);
        }

        $entities = [];
        foreach ($result as $row) {
            $model = clone $this->getModel();
            $model->populate($row);
            $entities[] = $model;
        }
        return $entities;
    }
1099352
protected function makeObjects(IResult $result) {

        // TODO: Prefer to return existing instances from IdentityMap

        $instances = [];
        while ($row = $result->fetchRow(ARRAY_ASSOC)) {
            $instances[] = PersistableObject::populateNew($this->entityClass, $row);
        }
        return $instances;
    }
1035510
protected function _makeMultiGetResult(array $result) {
        return MultiGetResult::make($result, $this->getClient())->setModelClass($this->_fullModelClassNamePattern());
    }
1331717
public function getResponse($result)
    {
        $content = $result->getContent();

        if ($result->headers->get('content-type') == 'application/json'){
            $content = json_decode($result->getContent(),true);
        }

        return array(
          'type' => 'rpc',
          'tid' => $this->tid,
          'action' => $this->action,
          'method' => $this->method,
          'result' => $content
        );
    }
759899
private function getCommunicationErrorFields(Result $result)
    {
        $fields = array();
        $fields += array(
            'messages' => array(
                'type' => 'markup',
                'label' => $this->t('messages'),
                'value' => $result->getMessages(Result::Format_FormattedText),
            ),
        );
        return $fields;
    }
495422
public function mapFromResults(array $arr_results)
    {
        $arr_entities = [];
        foreach ($arr_results as $obj_result) {
            $arr_entities[] = $this->mapOneFromResult($obj_result);
        }
        return $arr_entities;
    }
960862
protected function reduceResult($result)
    {
        if (is_array($result) && (count($result) == 1)) {
            reset($result);
            return $this->reduceResult($result[key($result)]);
        } else {
            return $result;
        }
    }