XeroAPI / xero-php-oauth2

Xero PHP SDK for oAuth 2 generated from Xero API OpenAPI Spec 3.0
MIT License
91 stars 65 forks source link

Just wondering when using the $where parameter, what is the syntax when finding by more than one field #162

Closed Budrose closed 3 years ago

Budrose commented 4 years ago

SDK you're using (please complete the following information):

Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like A clear and concise description of what you want to happen.

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

Additional context Add any other context or screenshots about the feature request here.

SidneyAllen commented 3 years ago

@Budrose

If you wanted to use the where clause to GET all ACCOUNTs where the status is active and type is bank you'd use the following .

$where = 'Status=="' . \XeroAPI\XeroPHP\Models\Accounting\Account::STATUS_ACTIVE .'" AND Type=="' .  \XeroAPI\XeroPHP\Models\Accounting\Account::BANK_ACCOUNT_TYPE_BANK . '"';
$result = $apiInstance->getAccounts($xeroTenantId, null, $where);