List of all members.
Public Member Functions |
| Group (stdClass $data, Api $api) |
| getID () |
| getName () |
| getEmail () |
| update ($email, $username, $password, $name) |
| delete () |
| getUsers () |
| addUser ($userID, $userName) |
| addSensors ($sensor_ids) |
| listSensors ($page, $perPage, $shared, $owned, $physical) |
| listSensorTags ($details=NULL, $namespace=NULL, $sensor_owner=NULL, $page=-1, $per_page=-1) |
| findSensorsByTagsInGroup ($filter, $details=NULL, $namespace=NULL, $sensor_owner=NULL, $page=-1, $per_page=-1) |
Detailed Description
sense dashboard - Group.php
This file is part of sense dashboard.
- Author:
- Remi Appels <remi@sense-os.nl> The class Group handels all the group actions
public
- Author:
- Remi Appels <remi@sense-os.nl>
Member Function Documentation
This method will add sensors to the group.
public
- Parameters:
-
- Returns:
- mixed
This method will add a user to the group. To add a user at least a username or user_id must be specified. Only members of the group can add a user to the group.
public
- Parameters:
-
- Returns:
- mixed
This method deletes the group if the group has no other members. If the group has other members then the current user will be removed from the group.
public
- Returns:
- json object
Finding sensors by metatags
Via this method a list of sensors can be selected based on a set of conditions. Supported operators are “equal”, “in”, and “is_set”. All string comparisons are case INsensitive. Currently supported are two types of statement groups. The first is "metatag_statement_groups" which allows to find sensors based on their metatags. The second is "sensor_statement_groups" which allows to find sensors based on their own properties. Supported properties are id, name, type, device_type, data_type_id, pager_type, display_name and use_data_storage.
public
- Parameters:
-
int | group_id The group identifier |
array | filter {"filter":{"metatag_statement_groups":[[{"metatag_name":"greenhouse_number","operator":"equal","value":"1"},{"metatag_name":"greenhouse_number","operator":"equal","value":"2"}],[{"metatag_name":"color","operator":"equal","value":"green"}]],"sensor_statement_groups":[[{"sensor_property":"id","operator":"in","value":"1,2,3,4,5,6,7,8,9,10"}]]}} |
string | details (optional) To get all the related data as name, display_name, type, device_type, data_typ_id, pager_type, data_type and data_structure the parameter details=full can be used. If only a list of sensor id's is needed then details=no can be used. |
string | namespace (optional) Find metatags within the given namespace. If not given “default” is assumed as the namepace. |
string | sensor_owner (optional) “me” only return metatags of sensors owned by the current user. “shared” only return sensors shared with me. "all” return all sensors owned by me or shared with me. When not given “me” is assumed |
int | page (optional) This parameter specifies which page of the results must be retrieved. The page offset starts at 0. |
int | per_page (optional) This parameter specifies the amount of sensors that must be received at once. The maximum amount is 1000 items |
This methods returns the members of the group as a list of users. Only group members can perform this action.
public
- Returns:
- mixed
This method returns a list of sensors of a group.
public
- Parameters:
-
int | page |
int | perPage |
Boolean | shared |
Boolean | owned |
Boolean | physical |
Boolean | details |
- Returns:
- mixed
Group::listSensorTags |
( |
$ |
details = NULL , |
|
|
$ |
namespace = NULL , |
|
|
$ |
sensor_owner = NULL , |
|
|
$ |
page = -1 , |
|
|
$ |
per_page = -1 |
|
) |
| |
List sensor tags within a group
This method will return a list of sensors with their metatags in the given group.
public
- Parameters:
-
string | details To get all the related data as name, display_name, type, device_type, data_typ_id, pager_type, data_type and data_structure the parameter details=full can be used. If only a list of sensor id's is needed then details=no can be used. |
string | namespace Find metatags within the given namespace. If not given “default” is assumed as the namepace. |
string | sensor_owner “me” only return metatags of sensors owned by the current user. “shared” only return sensors shared with me. "all” return all sensors owned by me or shared with me. When not given “me” is assumed |
int | page This parameter specifies which page of the results must be retrieved. The page offset starts at 0. |
int | per_page This parameter specifies the amount of sensors that must be received at once. The maximum amount is 1000 items |
This method will update the details of a group. Only the values specified as input will be updates. Every member of the group can update the group details
public
- Parameters:
-
string | email |
string | username |
string | password |
string | name |
- Returns:
- json object
The documentation for this class was generated from the following file: