|
dolibarr 21.0.4
|


Public Member Functions | |
| __construct () | |
| Constructor. | |
| get ($id) | |
| Get properties of a member object. | |
| getByThirdparty ($thirdparty) | |
| Get properties of a member object by linked thirdparty. | |
| getByThirdpartyAccounts ($site, $key_account) | |
| Get properties of a member object by linked thirdparty account. | |
| getByThirdpartyEmail ($email) | |
| Get properties of a member object by linked thirdparty email. | |
| getByThirdpartyBarcode ($barcode) | |
| Get properties of a member object by linked thirdparty barcode. | |
| index ($sortfield="t.rowid", $sortorder='ASC', $limit=100, $page=0, $typeid='', $category=0, $sqlfilters='', $properties='', $pagination_data=false) | |
| List members. | |
| post ($request_data=null) | |
| Create member object. | |
| put ($id, $request_data=null) | |
| Update member. | |
| delete ($id) | |
| Delete member. | |
| getSubscriptions ($id) | |
| List subscriptions of a member. | |
| createSubscription ($id, $start_date, $end_date, $amount, $label='') | |
| Add a subscription for a member. | |
| getCategories ($id, $sortfield="s.rowid", $sortorder='ASC', $limit=0, $page=0) | |
| Get categories for a member. | |
| getType ($id) | |
| Get properties of a member type object. | |
| indexType ($sortfield="t.rowid", $sortorder='ASC', $limit=100, $page=0, $sqlfilters='', $properties='', $pagination_data=false) | |
| List members types. | |
| postType ($request_data=null) | |
| Create member type object. | |
| putType ($id, $request_data=null) | |
| Update member type. | |
| deleteType ($id) | |
| Delete member type. | |
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 | |
| _validate ($data) | |
| Validate fields before creating an object. | |
| _validateType ($data) | |
| Validate fields before creating an 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 37 of file api_members.class.php.
|
protected |
Clean sensible object datas.
| Object | $object | Object to clean |
Reimplemented from DolibarrApi.
Definition at line 541 of file api_members.class.php.
References $object.
Referenced by get(), getByThirdparty(), getByThirdpartyAccounts(), getByThirdpartyBarcode(), getByThirdpartyEmail(), getSubscriptions(), getType(), index(), and indexType().
|
private |
Validate fields before creating an object.
| array<string,null|int|float|string> | $data Data to validate |
| RestException |
Definition at line 517 of file api_members.class.php.
Referenced by post().
|
private |
Validate fields before creating an object.
| ?array<string,null|int|float|string> | $data Data to validate |
| RestException |
Definition at line 986 of file api_members.class.php.
Referenced by postType().
| Members::createSubscription | ( | $id, | |
| $start_date, | |||
| $end_date, | |||
| $amount, | |||
| $label = '' ) |
Add a subscription for a member.
| int | $id | ID of member |
| string | $start_date | Start date {@from body} {@type timestamp} |
| string | $end_date | End date {@from body} {@type timestamp} |
| float | $amount | Amount (may be 0) {@from body} |
| string | $label | Label {@from body} |
@url POST {id}/subscriptions
| RestException | 403 Access denied |
| RestException | 404 Member not found |
Definition at line 656 of file api_members.class.php.
References $id.
| Members::delete | ( | $id | ) |
Delete member.
| int | $id | member ID |
| RestException | 403 Access denied |
| RestException | 404 Member not found |
| RestException | 500 Error when deleting a Member |
Definition at line 479 of file api_members.class.php.
References $id, and DolibarrApi\_checkAccessToResource().
| Members::deleteType | ( | $id | ) |
Delete member type.
| int | $id | member type ID |
@url DELETE /types/{id}
| RestException | 403 Access denied |
| RestException | 404 No Member Type found |
| RestException | 500 Error when deleting Member Type |
Definition at line 950 of file api_members.class.php.
References $id, and DolibarrApi\_checkAccessToResource().
| Members::get | ( | $id | ) |
Get properties of a member object.
Return an array with member information
| int | $id | ID of member |
| RestException | 403 Access denied |
| RestException | 404 Member not found |
Definition at line 67 of file api_members.class.php.
References $id, DolibarrApi\_checkAccessToResource(), and _cleanObjectDatas().
| Members::getByThirdparty | ( | $thirdparty | ) |
Get properties of a member object by linked thirdparty.
Return an array with member information
| int | $thirdparty | ID of third party |
@url GET thirdparty/{thirdparty}
| RestException | 403 Access denied |
| RestException | 404 Member not found |
Definition at line 104 of file api_members.class.php.
References DolibarrApi\_checkAccessToResource(), and _cleanObjectDatas().
| Members::getByThirdpartyAccounts | ( | $site, | |
| $key_account ) |
Get properties of a member object by linked thirdparty account.
| string | $site | Site key |
| string | $key_account | Key of account |
| RestException | 401 Unauthorized: User does not have permission to read thirdparties |
| RestException | 404 Not Found: Specified thirdparty ID does not belongs to an existing thirdparty |
@url GET thirdparty/accounts/{site}/{key_account}
Definition at line 135 of file api_members.class.php.
References DolibarrApi\_checkAccessToResource(), and _cleanObjectDatas().
| Members::getByThirdpartyBarcode | ( | $barcode | ) |
Get properties of a member object by linked thirdparty barcode.
Return an array with member information
| string | $barcode | Barcode of third party |
@url GET thirdparty/barcode/{barcode}
| RestException | 403 Access denied |
| RestException | 404 Member or ThirdParty not found |
Definition at line 225 of file api_members.class.php.
References DolibarrApi\_checkAccessToResource(), and _cleanObjectDatas().
| Members::getByThirdpartyEmail | ( | ) |
Get properties of a member object by linked thirdparty email.
Return an array with member information
| string | Email of third party |
@url GET thirdparty/email/{email}
| RestException | 403 Access denied |
| RestException | 404 Member or ThirdParty not found |
Definition at line 186 of file api_members.class.php.
References DolibarrApi\_checkAccessToResource(), and _cleanObjectDatas().
| Members::getCategories | ( | $id, | |
| $sortfield = "s.rowid", | |||
| $sortorder = 'ASC', | |||
| $limit = 0, | |||
| $page = 0 ) |
Get categories for a member.
| int | $id | ID of member |
| string | $sortfield | Sort field |
| string | $sortorder | Sort order |
| int | $limit | Limit for list |
| int | $page | Page number |
@url GET {id}/categories
| RestException | 403 Access denied |
| RestException | 404 Category not found |
| RestException | 503 Error when retrieving Category list |
Definition at line 688 of file api_members.class.php.
References $id.
| Members::getSubscriptions | ( | $id | ) |
List subscriptions of a member.
Get a list of subscriptions
| int | $id | ID of member |
@url GET {id}/subscriptions
| RestException | 403 Access denied |
| RestException | 404 Member not found |
Definition at line 622 of file api_members.class.php.
References $id, and _cleanObjectDatas().
| Members::getType | ( | $id | ) |
Get properties of a member type object.
Return an array with member type information
| int | $id | ID of member type |
@url GET /types/{id}
| RestException | 403 Access denied |
| RestException | 404 No Member Type found |
Definition at line 727 of file api_members.class.php.
References $id, DolibarrApi\_checkAccessToResource(), and _cleanObjectDatas().
| Members::index | ( | $sortfield = "t.rowid", | |
| $sortorder = 'ASC', | |||
| $limit = 100, | |||
| $page = 0, | |||
| $typeid = '', | |||
| $category = 0, | |||
| $sqlfilters = '', | |||
| $properties = '', | |||
| $pagination_data = false ) |
List members.
Get a list of members
| string | $sortfield | Sort field |
| string | $sortorder | Sort order |
| int | $limit | Limit for list |
| int | $page | Page number |
| string | $typeid | ID of the type of member |
| int | $category | Use this param to filter list by category |
| string | $sqlfilters | Other criteria to filter answers separated by a comma. Example: "(t.ref:like:'SO-%') and ((t.date_creation:<:'20160101') or (t.nature:is:NULL))" |
| string | $properties | Restrict the data returned to these properties. Ignored if empty. Comma separated list of properties names |
| bool | $pagination_data | If this parameter is set to true the response will include pagination data. Default value is false. Page starts from 0* |
| RestException | 400 Error on SQL filters |
| RestException | 403 Access denied |
| RestException | 404 No Member found |
| RestException | 503 Error when retrieving Member list |
Definition at line 274 of file api_members.class.php.
References _cleanObjectDatas(), DolibarrApi\_filterObjectProperties(), and forgeSQLFromUniversalSearchCriteria().
| Members::indexType | ( | $sortfield = "t.rowid", | |
| $sortorder = 'ASC', | |||
| $limit = 100, | |||
| $page = 0, | |||
| $sqlfilters = '', | |||
| $properties = '', | |||
| $pagination_data = false ) |
List members types.
Get a list of members types
| string | $sortfield | Sort field |
| string | $sortorder | Sort order |
| int | $limit | Limit for list |
| int | $page | Page number |
| string | $sqlfilters | Other criteria to filter answers separated by a comma. Syntax example "(t.libelle:like:'SO-%') and (t.subscription:=:'1')" |
| string | $properties | Restrict the data returned to these properties. Ignored if empty. Comma separated list of properties names |
| bool | $pagination_data | If this parameter is set to true the response will include pagination data. Default value is false. Page starts from 0* |
@url GET /types/
| RestException | 403 Access denied |
| RestException | 404 No Member Type found |
| RestException | 503 Error when retrieving Member list |
Definition at line 768 of file api_members.class.php.
References _cleanObjectDatas(), DolibarrApi\_filterObjectProperties(), and forgeSQLFromUniversalSearchCriteria().
| Members::post | ( | $request_data = null | ) |
Create member object.
| array | $request_data | Request data @phan-param ?array<string,string> $request_data @phpstan-param ?array<string,string> $request_data |
| RestException | 403 Access denied |
| RestException | 500 Error when creating Member |
Definition at line 366 of file api_members.class.php.
References DolibarrApi\_checkValForAPI(), _validate(), and sanitizeVal().
| Members::postType | ( | $request_data = null | ) |
Create member type object.
| array | $request_data | Request data @phan-param ?array<string,string> $request_data @phpstan-param ?array<string,string> $request_data |
@url POST /types/
| RestException | 403 Access denied |
| RestException | 500 Error when creating Member Type |
Definition at line 852 of file api_members.class.php.
References DolibarrApi\_checkValForAPI(), _validateType(), and sanitizeVal().
| Members::put | ( | $id, | |
| $request_data = null ) |
Update member.
| int | $id | ID of member to update |
| array | $request_data | Datas @phan-param ?array<string,string> $request_data @phpstan-param ?array<string,string> $request_data |
| RestException | 403 Access denied |
| RestException | 404 Member not found |
| RestException | 500 Error when resiliating, validating, excluding, updating a Member |
Definition at line 403 of file api_members.class.php.
References $id, DolibarrApi\_checkAccessToResource(), DolibarrApi\_checkValForAPI(), and sanitizeVal().
| Members::putType | ( | $id, | |
| $request_data = null ) |
Update member type.
| int | $id | ID of member type to update |
| array | $request_data | Datas @phan-param ?array<string,string> $request_data @phpstan-param ?array<string,string> $request_data |
@url PUT /types/{id}
| RestException | 403 Access denied |
| RestException | 404 No Member Type found |
| RestException | 500 Error when updating Member Type |
Definition at line 891 of file api_members.class.php.
References $id, DolibarrApi\_checkAccessToResource(), DolibarrApi\_checkValForAPI(), and sanitizeVal().