Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot use object of type stdClass as array #11

Open
Devin0231577 opened this issue Nov 13, 2019 · 0 comments
Open

Cannot use object of type stdClass as array #11

Devin0231577 opened this issue Nov 13, 2019 · 0 comments

Comments

@Devin0231577
Copy link

Devin0231577 commented Nov 13, 2019

On line 207 of Analytics.php you have
$cols[] = $col['label'];

So I had to rewrite the function as

public function parseResult($results) {
        $simpleDataTable = $results->getDataTable()->toSimpleObject();
        foreach ($simpleDataTable->cols as $col) {
            $cols[] = $col->label;
        }
        foreach ($simpleDataTable->rows as $row) {
            foreach ($row->c as $key => $value) {
                $rowData[$cols[$key]] = $value->v;
            }

            $rows[] = $rowData;

            unset($rowData);
        }
        return [
            'cols' => $cols,
            'rows' => $rows,
        ];
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant