|
dolibarr 22.0.5
|


Public Member Functions | |
| __construct () | |
| Constructor of the class. | |
| getById ($id) | |
| Get properties of a ObjectLink object. | |
| create ($request_data=null) | |
| Create object link. | |
| deleteById ($id) | |
| Delete an object link. | |
| getByValues ($fk_source, $sourcetype, $fk_target, $targettype, $relationtype=null) | |
| GET object link(s) By Values, not id. | |
| deleteByValues ($fk_source, $sourcetype, $fk_target, $targettype, $relationtype=null, $notrigger=0) | |
| Delete object link By Values, not id. | |
Public Member Functions inherited from DolibarrApi | |
| __construct ($db, $cachedir='', $refreshCache=false) | |
| Constructor. | |
Protected Member Functions | |
| _cleanObjectDatas ($object) | |
| Clean sensible object datas. | |
Protected Member Functions inherited from DolibarrApi | |
| _checkValForAPI ($field, $value, $object) | |
| Check and convert a string depending on its type/name. | |
| _filterObjectProperties ($object, $properties) | |
| Filter properties that will be returned on object. | |
| _checkFilters ($sqlfilters, &$error='') | |
| Return if a $sqlfilters parameter is valid Function no more used. | |
Private Member Functions | |
| _setObjectLinkField ($field, $value) | |
| Set a field of $this->objectlink, with proper type. | |
| _fetch ($id) | |
| Get properties of an object link. | |
| _validate ($data) | |
| Validate fields before create or update object. | |
Additional Inherited Members | |
Static Protected Member Functions inherited from DolibarrApi | |
| static | _checkAccessToResource ($resource, $resource_id=0, $dbtablename='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid') |
| Check access by user to a given resource. | |
| static | _forge_criteria_callback ($matches) |
| Function to forge a SQL criteria from a Generic filter string. | |
Definition at line 33 of file api_objectlinks.class.php.
|
protected |
Clean sensible object datas.
| Object | $object | Object to clean @phan-param ObjectLink $object @phpstan-param ObjectLink $object |
Reimplemented from DolibarrApi.
Definition at line 420 of file api_objectlinks.class.php.
References $object.
Referenced by _fetch(), and getByValues().
|
private |
Get properties of an object link.
Return an array with object links
| int | $id | ID of objectlink |
| RestException | 403 |
| RestException | 404 |
Definition at line 383 of file api_objectlinks.class.php.
References $id, and _cleanObjectDatas().
Referenced by getById().
|
private |
Set a field of $this->objectlink, with proper type.
| string | $field | The field to set |
| string | float | $value | The "unclean" value |
Fields that are of integer type, used for casting during object creation and update
Definition at line 95 of file api_objectlinks.class.php.
References DolibarrApi\_checkValForAPI().
Referenced by create(), deleteByValues(), and getByValues().
|
private |
Validate fields before create or update object.
| ?array<string,null|int|string> | $data Data to validate |
| RestException | 400 |
Definition at line 516 of file api_objectlinks.class.php.
Referenced by create(), deleteByValues(), and getByValues().
| ObjectLinks::create | ( | $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 | $request_data | Request data, see Example above for required parameters. Currently unused is relationtype. notrigger is default 0, which means to trigger, else set notrigger: 1 @phan-param ?array<string,string> $request_data @phpstan-param ?array<string,string> $request_data |
@url POST
| RestException | 304 |
| RestException | 403 |
| RestException | 500 |
Definition at line 137 of file api_objectlinks.class.php.
References _setObjectLinkField(), and _validate().
| ObjectLinks::deleteById | ( | $id | ) |
Delete an object link.
| int | $id | object link ID |
@url DELETE {id}
| RestException | 403 |
| RestException | 404 |
| RestException | 500 |
Definition at line 198 of file api_objectlinks.class.php.
References $id.
| ObjectLinks::deleteByValues | ( | $fk_source, | |
| $sourcetype, | |||
| $fk_target, | |||
| $targettype, | |||
| $relationtype = null, | |||
| $notrigger = 0 ) |
Delete object link By Values, not id.
| int | $fk_source | source id of object we link from |
| string | $sourcetype | type of the source object |
| int | $fk_target | target id of object we link to |
| string | $targettype | type of the target object |
| string | $relationtype | type of the relation, usually null |
| int | $notrigger | 1=Does not execute triggers, 0=execute triggers {@choice 0,1} |
@url DELETE
| RestException | 403 |
| RestException | 404 |
| RestException | 500 |
Definition at line 315 of file api_objectlinks.class.php.
References _setObjectLinkField(), and _validate().
| ObjectLinks::getById | ( | $id | ) |
Get properties of a ObjectLink object.
Return an array with object link information
| int | $id | ID of objectlink |
@url GET {id}
| RestException | 403 |
| RestException | 404 |
Definition at line 81 of file api_objectlinks.class.php.
| ObjectLinks::getByValues | ( | $fk_source, | |
| $sourcetype, | |||
| $fk_target, | |||
| $targettype, | |||
| $relationtype = null ) |
GET object link(s) By Values, not id.
| int | $fk_source | source id of object we link from |
| string | $sourcetype | type of the source object |
| int | $fk_target | target id of object we link to |
| string | $targettype | type of the target object |
| string | $relationtype | type of the relation, usually null |
@url GET
| RestException | 403 |
| RestException | 404 |
| RestException | 500 |
Definition at line 251 of file api_objectlinks.class.php.
References _cleanObjectDatas(), _setObjectLinkField(), and _validate().