Skip to content

Commit de8560f

Browse files
committed
Docs.
1 parent 434c83e commit de8560f

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

README.md

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,20 @@
22

33
Tested against Laravel 5.7 and Odoo 7.
44

5-
More docs to do, examples to wite, and the write interfaces to produce.
5+
More docs to do, examples to write, and the write interfaces to produce.
66

77
# Example
88

99
A very simple example:
1010

1111
```php
12+
// The facade.
13+
1214
use OdooApi;
1315

16+
// The default config.
17+
// getClient() will take other configuration names.
18+
1419
$client = OdooApi::getClient();
1520

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

29-
// First 10 macthing IDs
34+
// First 10 matching IDs
3035

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

3338
// Total count for the criteria.
3439

3540
$client->searchCount('res.partner', $criteria);
41+
42+
// Read the complete details of two specific partners.
43+
44+
$client->read('res.partner', [17858, 17852])->value()->me['array']
3645
```
3746

3847
# TODO
3948

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

0 commit comments

Comments
 (0)