saintsystems / odata-client-php

OData Client Library for PHP
MIT License
141 stars 103 forks source link

Support for OData Int64 identifiers #137

Open gRegorLove opened 1 year ago

gRegorLove commented 1 year ago

I think the wrapKey function is not aware of 64-bit integers (Edm.Int64) with format [-] [0-9]+L.

I tried a query with one which generated the filter: $filter=(ID eq '354760000354760L').

Instead, I would expect it to generate: $filter=(ID eq 354760000354760L).

The error response from the service was:

The query specified in the URI is not valid. A binary operator with incompatible types was detected. Found operand types 'Edm.Int64' and 'Edm.String' for operator kind 'Equal'.

(Originally published at: https://gregorlove.com/2023/07/support-for-odata-int64-identifiers/)

anderly commented 11 months ago

@gRegorLove,

But you should be able to do 354760000354760 without the L suffix.

    $client->from('EntitySet')->whereKey(354760000354760);

Let me know if that doesn't work.