inakiabt / etsy-php

Etsy API wrapper for PHP
74 stars 59 forks source link

Added support for `fields` option #10

Closed Korri closed 8 years ago

Korri commented 9 years ago

Hey, thanks for the great library, needed to be hable to use the fields parameter to make a big request a bit faster, so here comes a patch, it works like expected:

$api->findAllShopListingsActive(array(
            'params' => array(
                'shop_id' => xxx
            ),
            'associations' => array(
                'Images',
                'Translations'
            ),
            'fields' => array(
                'listing_id', 'title', 'description', 'price', 'quantity', 'tags', 'url'
            )
        ));

See here for more infos about the fields param: https://www.etsy.com/developers/documentation/getting_started/resources#section_fields

Korri commented 9 years ago

Just realized naming it select might have been more consistent with the rest of the code, but seems an un-necessary abstraction.

inakiabt commented 8 years ago

Thanks and sorry for the late response.