I need to create a PHP OData producer supporting both GET and PUT. Up to now I've only found this library, unfortunately this not support PUT operation. Any suggestions? Thank's
Currently there's no PHP Library (public) available to support OData CUD (Change, Update and Delete) operations.
Just released. Documentation is coming.
https://packagist.org/packages/falseclock/dbd-php
$cache = DBD\Cache\MemCache::me()->create(array(['host' => '127.0.0.1', 'port' => 11211]),false,"15 min")->open();
$odata_options = array(
'RaiseError' => true,
'PrintError' => true,
'HTMLError' => true,
'CacheDriver' => $cache
);
$od = (new DBD\OData())->create('http://crm.beta.virtex.kz/odata/', "user", "password", $odata_options);
$sth = $od->prepare("
SELECT
Ref_Key, Number, Date
FROM
Document_Invoices
ORDER BY
Date аsc
LIMIT 10
");
$sth->cache('CacheKey','24h');
$sth->execute();
while ($row = $sth->fetchrow()) {
print_r($row);
}
$od->update(
'Document_Invoices',
array('Date' => $data['Date']),
"(guid?)",
$data['Ref_Key'] // for ?-placeholder
);