public function populate($rows): array
    {
        $result = [];

        if ($this->indexBy === null) {
            return array_values($rows); // reset storage internal keys
        }

        foreach ($rows as $row) {
            if (is_string($this->indexBy)) {
                $key = $row[$this->indexBy];
            } else {
                $key = call_user_func($this->indexBy, $row);
            }
            $result[$key] = $row;
        }

        return $result;
    }
public function populate($rows): array
    {
        $result = [];

        if ($this->indexBy === null) {
            return array_values($rows); // reset storage internal keys
        }

        foreach ($rows as $row) {
            if (is_string($this->indexBy)) {
                $key = $row[$this->indexBy];
            } else {
                $key = call_user_func($this->indexBy, $row);
            }
            $result[$key] = $row;
        }

        return $result;
    }
public function populate ( $ rows ) : array { $ result = [ ] ; if ( $ this -> indexBy === null ) { return array_values ( $ rows ) ; // reset storage internal keys } foreach ( $ rows as $ row ) { if ( is_string ( $ this -> indexBy ) ) { $ key = $ row [ $ this -> indexBy ] ; } else { $ key = call_user_func ( $ this -> indexBy , $ row ) ; } $ result [ $ key ] = $ row ; } return $ result ; }
Converts the raw query results into the format as specified by this query.

@param $rows

@return array
Converts the raw query results into the format as specified by this query .