Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/leblanc-simon/openerpbyxmlrpc
Library to communicate into PHP and OpenERP
https://github.com/leblanc-simon/openerpbyxmlrpc
Last synced: 4 days ago
JSON representation
Library to communicate into PHP and OpenERP
- Host: GitHub
- URL: https://github.com/leblanc-simon/openerpbyxmlrpc
- Owner: leblanc-simon
- License: mit
- Created: 2014-01-30T01:48:02.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2022-01-25T08:54:02.000Z (almost 3 years ago)
- Last Synced: 2024-04-18T01:03:05.220Z (7 months ago)
- Language: PHP
- Size: 43 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
OpenErpByXmlRpc
===============Library to communicate into PHP and OpenERP
[![SensioLabsInsight](https://insight.sensiolabs.com/projects/cbb0511c-4e82-4709-88e5-e080c99fba19/mini.png)](https://insight.sensiolabs.com/projects/cbb0511c-4e82-4709-88e5-e080c99fba19)
Usage
-----```php
use Monolog\Logger;
use Monolog\Handler\StreamHandler;
use OpenErpByXmlRpc\OpenErpByXmlRpc;// Configure Logger (if you want log request and response)
$logger = new Logger('xmlrpc');
$handler = new StreamHandler(__DIR__.'/logs/xmlrpc-'.date('Ymd').'.log', Logger::DEBUG);
$handler->setFormatter(new \Monolog\Formatter\LineFormatter(null, null, true));
$logger->pushHandler($handler);// Init the communication
$xmlrpc = new OpenErpByXmlRpc('localhost', 8069, 'database', 'username', 'password');
$xmlrpc->setLogger($logger); // Not required// Search datas
$user = $xmlrpc->search('res.users', array(array('login', '=', 'admin')));
// or
$user = $xmlrpc->search(
'res.users',
\OpenErpByXmlRpc\Criteria::create()->equal('login', 'admin')
);// Get and retrieve data
$user = $xmlrpc->read('res.users', 1, array('login'));
$users = $xmlrpc->read('res.users', array(1, 2), array('login'));// Call another method
$res = $xmlrpc->call('res.users', 'another_method', 'param1', 'param2', ...);
```Others methods exists, check in the source code !
Authors
-------* Simon Leblanc : [email protected]
License
-------[MIT](http://opensource.org/licenses/MIT)