GetList
CDBResult CSocNetUserToGroup::GetList( array arOrder = array("ID" => "DESC"), array arFilter = array(), array arGroupBy = false, array arNavStartParams = false, array arSelectFields = array() );
The method selects list of bindings between users and groups as per filter. Static method.
Parameters
Parameter | Description |
---|---|
arOrder | Returned list sorting order, specified as an array. Array keys are fields for sorting and values - ASC/DESC - sorting order. Permissible keys: ID, USER_ID, GROUP_ID, ROLE, DATE_CREATE, DATE_UPDATE, INITIATED_BY_TYPE, INITIATED_BY_USER_ID, GROUP_NAME, GROUP_SITE_ID, GROUP_VISIBLE, GROUP_OWNER_ID, GROUP_OPENED, GROUP_NUMBER_OF_MEMBERS, GROUP_DATE_ACTIVITY, USER_NAME, USER_LAST_NAME, USER_LOGIN, USER_EMAIL, USER_PERSONAL_PHOTO, USER_LID, INITIATED_BY_USER_NAME, INITIATED_BY_USER_LAST_NAME, INITIATED_BY_USER_LOGIN, INITIATED_BY_USER_EMAIL, RAND. |
arFilter | Array, specifying filter for returned list. Array keys are field names and values are such field values. Permissible fields: ID, USER_ID, GROUP_ID, ROLE, DATE_CREATE, DATE_UPDATE, INITIATED_BY_TYPE, INITIATED_BY_USER_ID, GROUP_NAME, GROUP_SITE_ID, GROUP_ACTIVE, GROUP_VISIBLE, GROUP_OWNER_ID, GROUP_INITIATE_PERMS, GROUP_OPENED, GROUP_NUMBER_OF_MEMBERS, GROUP_DATE_ACTIVITY, USER_ACTIVE, USER_NAME, USER_LAST_NAME, USER_LOGIN, USER_EMAIL, USER_LID, INITIATED_BY_USER_NAME, INITIATED_BY_USER_LAST_NAME, INITIATED_BY_USER_LOGIN, INITIATED_BY_USER_EMAIL. |
arGroupBy | Array, specifying grouping for the resulting list. When parameter contains an array of field names, which are used to perform grouping. When parameter contains an empty array, the method returns number of records that satisfy the filter. Default parameter is false: do not group. |
arNavStartParams | Array, specifying conditions of selection for pagewise navigation. |
arSelectFields | >Array, specifying, specifying selected fields. Contains list of fields to be returned by the method. When array is empty, the following fields are selected: ID, USER_ID, GROUP_ID, ROLE, DATE_CREATE, DATE_UPDATE, INITIATED_BY_TYPE, INITIATED_BY_USER_ID, MESSAGE. Any fields from the list above are permitted in the array. |
List of fields
ID - record ID;
USER_ID - user ID;
GROUP_ID - group ID;
ROLE - user role in group, constant values: SONET_ROLES_MODERATOR - moderator, SONET_ROLES_USER - user, SONET_ROLES_BAN - blacklist, SONET_ROLES_REQUEST - join request, SONET_ROLES_OWNER - owner;
DATE_CREATE - date when record is created;
DATE_UPDATE - date when record is updated;
INITIATED_BY_TYPE - who initialized binding: SONET_INITIATED_BY_USER - user, SONET_INITIATED_BY_GROUP - group,
INITIATED_BY_USER_ID - user ID, who initialized the binding,
MESSAGE - message when requesting to create binding.
GROUP_NAME - group name;
GROUP_SITE_ID - group site;
GROUP_DESCRIPTION - group description;
GROUP_ACTIVE - group activity status;
GROUP_IMAGE_ID - group icon ID;
GROUP_VISIBLE - group visibility;
GROUP_OWNER_ID - user ID - group owner;
GROUP_INITIATE_PERMS - who can invite to the group;
GROUP_OPENED - group open/closed attribute;
GROUP_NUMBER_OF_MEMBERS - number of group members;
GROUP_DATE_ACTIVITY - date of last activity in group;
USER_ACTIVE - user activity status;
USER_NAME - user name;
USER_LAST_NAME - user last name;
USER_LOGIN - user login;
USER_EMAIL - user e-mail;
USER_PERSONAL_PHOTO - user photo ID;
USER_LID - user site;
INITIATED_BY_USER_NAME - user name, who initialized the bidding;
INITIATED_BY_USER_LAST_NAME - user last name, who initialized the bidding;
INITIATED_BY_USER_LOGIN - user login, who initialized the bidding;
INITIATED_BY_USER_EMAIL - user e-mail, who initialized the bidding;
INITIATED_BY_USER_PHOTO => user photo ID, who initialized the bidding;
RAND - random number.
Returned value
The method returns CDBResult object, containing records, satisfying selection condition.
See Also
Examples
<? $dbRequests = CSocNetUserToGroup::GetList( array("USER_LAST_NAME" => "ASC", "USER_NAME" => "ASC"), array( "GROUP_ID" => $groupId, "<=ROLE" => SONET_ROLES_MODERATOR, "USER_ACTIVE" => "Y" ), false, $arNavParams, array("ID", "USER_ID", "DATE_CREATE", "DATE_UPDATE", "USER_NAME", "USER_LAST_NAME", "USER_PERSONAL_PHOTO") ); while ($arRequests = $dbRequests->GetNext()) { . . . } ?>