ObjectLinks
class ObjectLinks extends DolibarrApi (View source)
API that gives shows links between objects in an Dolibarr instance.
Properties
| protected DoliDB | $db | from DolibarrApi | |
| Restler | $r | from DolibarrApi | |
| static string[] | $FIELDS | ||
| ObjectLink | $objectlink |
Methods
Constructor of the class
Check and convert a string depending on its type/name.
Filter properties that will be returned on object
Clean sensible object datas
Check access by user to a given resource
Return if a $sqlfilters parameter is valid Function no more used. Kept for backward compatibility with old APIs of modules
Function to forge a SQL criteria from a Generic filter string.
Get properties of a ObjectLink object
Create object link
Delete an object link
GET object link(s) By Values, not id
Delete object link By Values, not id
Details
__construct()
Constructor of the class
protected string|array<string, mixed>
_checkValForAPI(string $field, string|string[] $value, object $object)
Check and convert a string depending on its type/name.
protected object
_filterObjectProperties(object $object, string $properties)
Filter properties that will be returned on object
protected object
_cleanObjectDatas(object $object)
Clean sensible object datas
static protected bool
_checkAccessToResource(string $resource, int $resource_id = 0, string $dbtablename = '', string $feature2 = '', string $dbt_keyfield = 'fk_soc', string $dbt_select = 'rowid')
Check access by user to a given resource
protected bool|string
_checkFilters(string $sqlfilters, string $error = '')
Return if a $sqlfilters parameter is valid Function no more used. Kept for backward compatibility with old APIs of modules
static protected string
_forge_criteria_callback(string[] $matches)
Function to forge a SQL criteria from a Generic filter string.
Function no more used. Kept for backward compatibility with old APIs of modules
object
getById(int $id)
Get properties of a ObjectLink object
Return an array with object link information
create(array $request_data = null)
Create object link
Examples: Only set "notrigger": 1 because 0 is the default value. Linking subscriptions for when you sell membership as part of another sale {"fk_source":"1679","sourcetype":"propal","fk_target":"1233","targettype":"commande"} {"fk_source":"167","sourcetype":"facture","fk_target":"123","targettype":"subscription"}
array
deleteById(int $id)
Delete an object link
getByValues($fk_source, string $sourcetype, $fk_target, $targettype, $relationtype = null)
GET object link(s) By Values, not id
@param int $fk_source source id of object we link from
deleteByValues($fk_source, string $sourcetype, $fk_target, $targettype, $relationtype = null, int $notrigger = 0)
Delete object link By Values, not id
@param int $fk_source source id of object we link from