Skip to content

Commit

Permalink
Docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
judgej committed Feb 8, 2019
1 parent 434c83e commit de8560f
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,20 @@

Tested against Laravel 5.7 and Odoo 7.

More docs to do, examples to wite, and the write interfaces to produce.
More docs to do, examples to write, and the write interfaces to produce.

# Example

A very simple example:

```php
// The facade.

use OdooApi;

// The default config.
// getClient() will take other configuration names.

$client = OdooApi::getClient();

// Note the criteria is a nested list of scalar values.
Expand All @@ -26,24 +31,31 @@ $criteria = [
]
];

// First 10 macthing IDs
// First 10 matching IDs

$client->search('res.partner', $criteria, 0, 10, 'id desc')->value()->me['array']

// Total count for the criteria.

$client->searchCount('res.partner', $criteria);

// Read the complete details of two specific partners.

$client->read('res.partner', [17858, 17852])->value()->me['array']
```

# TODO

* An elegant way to parse the results, as the `Value` objects can be
a little cumbersome.
For example, we know the `search()` result will be an array of
integer model instance IDs, so a simple array of IDs can be returned,
rather than a Value array containing Value integer objects.
integer model instance IDs, so a simple array or collection of IDs can
be returned, rather than a Value array containing Value integer objects.
* Docs on config (this package supports multiple clients, so can connect
to multiple Odoo instances or as multiple users at the same time).
* Docs on installation (has a auto discovered provider and facade).
Includes details on how to publish the config file.
* The write functions are not written yet (create, write and unlink).
* The search_read method is not supported yet.
* The setting of the configuration could be done in a more fluent
way, as tends to be the Laravel way. But it's no biggie.

0 comments on commit de8560f

Please sign in to comment.