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

Add matchBySku method to inventoryEntries #64

Open
emmenko opened this issue May 1, 2015 · 4 comments
Open

Add matchBySku method to inventoryEntries #64

emmenko opened this issue May 1, 2015 · 4 comments

Comments

@emmenko
Copy link
Member

emmenko commented May 1, 2015

client.inventoryEntries.all().matchBySku(['a', 'b', 'c', 'd']).fetch()

The function is an helper to build a query predicate using in operator

predicate = 'sku in ("a", "b", "c", "d")'

See https://github.com/sphereio/sphere-stock-import/blob/master/src/coffee/stockimport.coffee#L223-L227

@yanns
Copy link
Contributor

yanns commented May 2, 2015

And what about a more general function, like:
client.inventoryEntries.all().where('sku').in(['a', 'b', 'c', 'd']).fetch()

@emmenko
Copy link
Member Author

emmenko commented May 2, 2015

It would be nice, but unfortunately not possible. where doesn't return a query builder but the instance of the service. Also it can be chained multiple times and it would be really hard to build the predicate like this.

@yanns
Copy link
Contributor

yanns commented May 2, 2015

OK, thx for the info!

@hajoeichler
Copy link
Member

This should be available also for products.

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

No branches or pull requests

5 participants