odata-client-php icon indicating copy to clipboard operation
odata-client-php copied to clipboard

where chained with orWhere fails

Open dimitrigogios opened this issue 3 years ago • 2 comments

Hi, I'm trying to do a where chained together with an orWhere. But it fails:

$orders1 = $odataClient->from('orders')
                ->where([
                    ['Sell_to_Customer_No', '=', $customerNo],
                    ["Document_No", ">=", $term],
                ])
                ->orWhere([
                    ['Sell_to_Customer_No', '=', $customerNo],
                    ["No", ">=", $term],
                ])
                ->order("Document_No", "desc")
                ->get()

dimitrigogios avatar Jan 18 '22 21:01 dimitrigogios

Can you tell what the generated URL is?

Might be worth putting together a quick unit test like those in BuilderTest.php with your where and orWhere calls and generating the request URI to track down where the issue is.

anderly avatar Jan 18 '22 21:01 anderly

No I can't see the generated URL?

dimitrigogios avatar Jan 19 '22 18:01 dimitrigogios

Added tests to cover this in 5318323 and c38e00d, but unable to reproduce.

anderly avatar Sep 07 '23 05:09 anderly