src/Common/Connection.php
private function processWithKey(array $rows, $keyField)
    {
        if (empty($rows)) {
            return [];
        }

        $first = reset($rows);

        if (!isset($first->$keyField)) {
            throw new FieldNotFoundException($keyField . ' field not found in result of the query');
        }

        $result = [];
        foreach ($rows as $row) {
            $result[$row->$keyField] = $row;
        }

        return $result;
    }
private function processWithKey(array $rows, $keyField)
    {
        if (empty($rows)) {
            return [];
        }

        $first = reset($rows);

        if (!isset($first->$keyField)) {
            throw new FieldNotFoundException($keyField . ' field not found in result of the query');
        }

        $result = [];
        foreach ($rows as $row) {
            $result[$row->$keyField] = $row;
        }

        return $result;
    }
private function processWithKey ( array $ rows , $ keyField ) { if ( empty ( $ rows ) ) { return [ ] ; } $ first = reset ( $ rows ) ; if ( ! isset ( $ first -> $ keyField ) ) { throw new FieldNotFoundException ( $ keyField . ' field not found in result of the query' ) ; } $ result = [ ] ; foreach ( $ rows as $ row ) { $ result [ $ row -> $ keyField ] = $ row ; } return $ result ; }
Process the queried rows into an array which has the keyField keys

@param array  $rows
@param string $keyField

@return array
@throws FieldNotFoundException
Process the queried rows into an array which has the keyField keys