This pull request implements query builders for products, orders & customers.
This means we can use the same query across multiple repositories which was previously not possible as you had to implement the same-ish query two/three times depending on the repository in use.
The query builders extend the EntryQueryBuilder and EloquentQueryBuilder that are built into Statamic.
This PR shouldn't make much of a difference to end-developers, apart from the fact Product::all()/Customer::all()/Order::all() will now return Simple Commerce objects, rather than entries/Eloquent models.
This PR also improves the state of testing around the various product/order/customer repositories.
To Do
[x] Implement query builders for orders
[x] Implement query builders for customers
[x] Implement query builders for products
[x] Add tests around the various query builders
[x] Refactor existing queries
[x] Make sure id column in Eloquent queries actually queries whatever the model key is.
This pull request implements query builders for products, orders & customers.
This means we can use the same query across multiple repositories which was previously not possible as you had to implement the same-ish query two/three times depending on the repository in use.
The query builders extend the
EntryQueryBuilder
andEloquentQueryBuilder
that are built into Statamic.This PR shouldn't make much of a difference to end-developers, apart from the fact
Product::all()
/Customer::all()
/Order::all()
will now return Simple Commerce objects, rather than entries/Eloquent models.This PR also improves the state of testing around the various product/order/customer repositories.
To Do
id
column in Eloquent queries actually queries whatever the model key is.