31,003
edits
No edit summary |
No edit summary |
||
| Line 7: | Line 7: | ||
* Update: update() | * Update: update() | ||
* Delete: delete() | * Delete: delete() | ||
= Linked business objects = | |||
Some business objects are linked to other. This is done into Dolibarr using the [[Table llx_element_element]]. But you don't have to read this table to get objects linked to another. | |||
This is a portion of code that show you how ou can do this: | |||
<source lang="php"> | |||
// This load the array linked_object with objects that link to this one | |||
$object->load_object_linked($object->id, $object->element); | |||
// To load array linked_object with objects that are linked by this one | |||
$object->load_object_linked($object->id, $object->element); | |||
// Then choose id with objects type you need | |||
$org_order_array = $object->linked_object["commande"]; | |||
// Now use them | |||
$thelinkedobjectid = $org_order_array[0]; | |||
// new order instance | |||
$thelinkedobject = new Commande($object->db); | |||
// load the object | |||
$thelinkedobject->fetch($thelinkedobjectid); | |||
</source> | |||
= Ejemplos = | = Ejemplos = | ||