Feature/xero if modified since
The Xero API allows for fetching items created or modified after a certain date by using the HTTP If-Modified-Since header. This change allows for easy use of that, including in a call chain, without having to separately set a header.
What I did
- Added parameter specifications to the get() method definition in the DF_Xero_Public class, to avoid a PHP warning about it not matching the signature of the method from the DF_Xero class that it overloads.
- Added an if_modified_since() utility method to DF_Xero, to allow for the common case of requesting items modified since a specified time.
Implications
None
Setup
None
How to test
- Code review.
- Can be tested with commit
104de2357cfcaaec87c4f858054e4819cbdafbcb
from the National Weighing project- Different results can be viewed with these URLs:
- https://www.nw.vm/xero_inventory/modified_since/2019-05-09T00:00:00
- https://www.nw.vm/xero_inventory/modified_since/2019-05-10T00:00:00