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

Count method expects an array or object #10

Closed
mertingen opened this issue Jun 20, 2019 · 6 comments
Closed

Count method expects an array or object #10

mertingen opened this issue Jun 20, 2019 · 6 comments

Comments

@mertingen
Copy link

Once I download line items, I've been getting this unexpected error. count(): Parameter must be an array or an object that implements Countable

@jimper
Copy link
Contributor

jimper commented Jun 21, 2019

Hi there,

Could you clarify which sample this relates to and the specific line generating the error? If you can provide a sanitized log of the request and response leading up to this is would be helpful.

Regards,
- Jonathon Imperiosi, DBM API Team

@mertingen
Copy link
Author

mertingen commented Jun 21, 2019 via email

@jimper
Copy link
Contributor

jimper commented Jun 21, 2019

Thanks for the additional info. Can you try modifying that line to:

if (empty($result['lineItems'])) {

And let me know if you're still getting an error?

@mertingen
Copy link
Author

mertingen commented Jun 21, 2019 via email

@jimper
Copy link
Contributor

jimper commented Jun 21, 2019

Thanks for confirming, I'll update the samples to remove count(). Since the value is always a string that check isn't even necessary. All we need to verify is that the field exists and is non-empty.

@mertingen
Copy link
Author

mertingen commented Jun 21, 2019 via email

@jimper jimper closed this as completed in 5ab7574 Jun 21, 2019
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

2 participants