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

Update SalesInvoice.php #7

Merged
merged 2 commits into from
Aug 10, 2015
Merged

Update SalesInvoice.php #7

merged 2 commits into from
Aug 10, 2015

Conversation

eMaurits
Copy link
Contributor

Updated with all the properties from the documentation

eMaurits added 2 commits July 31, 2015 09:23
Updated with all the properties from the documentation
stephangroen added a commit that referenced this pull request Aug 10, 2015
Added all documented properties to SalesInvoice entity
@stephangroen stephangroen merged commit d7c5f99 into picqer:master Aug 10, 2015
@stephangroen
Copy link
Member

Thanks @bertjuuhh !

@eMaurits
Copy link
Contributor Author

@stephangroen You're welcome.
I have on quick question, when i use the filter like your example : $item = new Item($connection);
$item->filter("Code eq '$productcode'");
How do i get the items from it. I used echo $item->propertyname in this case, but it stays empty.

@stephangroen
Copy link
Member

@bertjuuhh That's a bug, which I have just resolved :)

Filtering could return a single item or multiple items. We didn't account for that yet. I have made an adjustment, which makes filtering always return a collection of items, with just 1 item in the collection in case of a single item return. This ensures the filter() call will always return the same style of result. See: 9f84d7d

@eMaurits
Copy link
Contributor Author

@stephangroen Awesome, thankyou :)
I'll go take a look at it

@eMaurits
Copy link
Contributor Author

@stephangroen Do i still need to put an $item->get after the filter to get the results or am i missing something?

@stephangroen
Copy link
Member

@bertjuuhh No, $item->filter will return an collection (array) of resulting objects, which you can loop over with a foreach.

@eMaurits
Copy link
Contributor Author

Oke, thank you!

@eMaurits
Copy link
Contributor Author

@stephangroen i found the problem, i was looking up accounts with 'Code' but apparently you need the leading spaces in front of them to get results back.

@stephangroen
Copy link
Member

@bertjuuhh Yup, they require the leading spaces indeed. This is written somewhere in their docs :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants