Closed jimmymcpeter closed 7 years ago
@billystalnaker take a look at the query branch I just setup. There's a QueryInterface in there we're considering for v1.1 release. Check out some of the tests to see the usage
$condition = new GreaterThanOrEqualToInteger();
$condition->setField('RECORDNO');
$condition->setValue(1234);
$readByQuery = new ReadByQuery('unittest');
$readByQuery->setObjectName('CUSTOMER');
$readByQuery->setQuery($condition);
If folks want to manually write their own query strings, they're forced into the interface. The same above can be done through the QueryString class:
$readByQuery = new ReadByQuery('unittest');
$readByQuery->setObjectName('CUSTOMER');
$readByQuery->setQuery(new QueryString('RECORDNO >= 1234'));
An example of nested conditions -- https://github.com/Intacct/intacct-sdk-php/blob/query/test/Intacct/Functions/Common/Query/Logical/OrConditionTest.php#L86-L114
That's awesome. I'm out of town for two weeks. But I will check it out when I get back! Thanks!
We did this for
get_list
- https://github.com/Intacct/intacct-sdk-php/tree/master/src/Intacct/Functions/Common/GetListWe should add something similar to build the
<query>
block for the dev when they want to usereadByQuery
query parameter: A subset of standard SQL where clause. The following SQL operators are supported:
<
,>
,>=
,<=
,=
,LIKE
,NOT LIKE
,IN
,NOT IN
,IS NOT NULL
,IS NULL
. Multiple fields may be matched using theAND
andOR
operators. Joins are not supported. If the value you are filtering on contains an apostrophe, add a backslash before it to escape the apostrophe. For example, to filter onErik's Deli
in contacts, your query element would be:contactname = 'Erik\'s Deli'
Looking for
!=
operator? Prefix withNOT
for exampleNOT contactname = 'Erik\'s Deli'
Requested from issue #90