-
Notifications
You must be signed in to change notification settings - Fork 93
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
Added filters support for stub #270
Conversation
could you say more about how it would be used? some unit tests would be helpful towards that end. |
For example if you need to get an account information and need to get all subscription of this account which is active. But first of all you want be sure, that account is also active. $account = \Recurly_Account::get($account_id);
if ($account->state == 'active')
{
$subscriptionsForAccount = $account->subscriptions->get(); // old version
$subscriptionsForAccount = $account->subscriptions->get((array('state' => 'active')); // new version after update
} without this update you will get all subscription information without any filter so you should filter manually in code and not via request (which is not good point) Surely you can get subscription for account using $subscriptionsForAccount =\Recurly_SubscriptionList::getForAccount($account_id, array('state' => 'active')) But in this situation you can't check account is active or not... This is just one example with state filter, but you can use all filters which api allowed for that request. |
@drewish Please test and let me know the status. Thanks. |
@drewish do you have any updates? |
Yeah it looks like a really good enhancement. Do you mind adding a unit test for the new behavior? If you want to enable the new Allow edits from maintainers feature I'm happy to help with that. |
I enabled Allow edits from maintainers |
@developer-devPHP awesome. i threw a couple of commits on there. i'll have another dev here +1 it and merge. |
When `get()`ing a stub you're returning the full object so lets refer to it that way.
👍 |
Please test this improvements. I think this will be helpful.