Members
class Members extends DolibarrApi (View source)
API class for members
Properties
| protected DoliDB | $db | from DolibarrApi | |
| Restler | $r | from DolibarrApi | |
| static string[] | $FIELDS | ||
| AdherentStats | $memberstats |
Methods
Constructor
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 member object
Get properties of a member object by linked thirdparty
Get properties of a member object by linked thirdparty account
Get properties of a member object by linked thirdparty email
Get properties of a member object by linked thirdparty barcode
List members
Create member object
Update member
Delete member
List subscriptions of a member
Add a subscription for a member
Get categories for a member
Get properties of a member type object
List members types
Create member type object
Update member type
Delete member type
Return an array with the number of members by month for a given year
Return an array with the number of subscriptions by year
Return the number of subscriptions by month for a given year
Last Modified Members
Details
__construct()
Constructor
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
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
get(int $id)
Get properties of a member object
Return an array with member information
object
getByThirdparty(int $thirdparty)
Get properties of a member object by linked thirdparty
Return an array with member information
array|mixed
getByThirdpartyAccounts(string $site, string $key_account)
Get properties of a member object by linked thirdparty account
object
getByThirdpartyEmail(string $email)
Get properties of a member object by linked thirdparty email
Return an array with member information
object
getByThirdpartyBarcode(string $barcode)
Get properties of a member object by linked thirdparty barcode
Return an array with member information
array
index(string $sortfield = "t.rowid", string $sortorder = 'ASC', int $limit = 100, int $page = 0, string $typeid = '', int $category = 0, string $sqlfilters = '', string $properties = '', bool $pagination_data = false)
List members
Get a list of members
int
post(array $request_data = null)
Create member object
object
put(int $id, array $request_data = null)
Update member
array
delete(int $id)
Delete member
array
getSubscriptions(int $id)
List subscriptions of a member
Get a list of subscriptions
int
createSubscription(int $id, string $start_date, string $end_date, float $amount, string $label = '')
Add a subscription for a member
mixed
getCategories(int $id, string $sortfield = "s.rowid", string $sortorder = 'ASC', int $limit = 0, int $page = 0)
Get categories for a member
object
getType(int $id)
Get properties of a member type object
Return an array with member type information
array
indexType(string $sortfield = "t.rowid", string $sortorder = 'ASC', int $limit = 100, int $page = 0, string $sqlfilters = '', string $properties = '', bool $pagination_data = false)
List members types
Get a list of members types
int
postType(array $request_data = null)
Create member type object
object
putType(int $id, array $request_data = null)
Update member type
array
deleteType(int $id)
Delete member type
array
getNbByMonth(int $year, int $format = 0)
Return an array with the number of members by month for a given year
array
getNbByYear()
Return an array with the number of subscriptions by year
array
getAmountByMonth(int $year, int $format = 0)
Return the number of subscriptions by month for a given year
array
getLastModifiedMembers(int $max)
Last Modified Members
Get an array of statistics for last modified members