Bitrix Site Manager

CCatalogGroup::GetGroupsList

CDBResult
CCatalogGroup::GetGroupsList(
 array arFilter = Array()
);

The method GetGroupsList returns records from the binding table that describes relationships between price types and site users. The returned array is filtered using the parameters specified in arFilter.

Parameters

ParameterDescription
arFilter Array with fields by which the returned records are to be filtered. Keys are the field names; values are conditions. The array can have the following keys:
  • CATALOG_GROUP_ID - price type ID;
  • GROUP_ID - user group ID;
  • BUY - flag with values: "Y" - users of this group can purchase products at prices of this type; "N" - users of this group can view prices of this type;
  • ID - record ID.

Return Values

An instance of the class CDBResult containing a set of the associated arrays with the following keys.

Key Description
ID Record ID.
CATALOG_GROUP_ID Price type ID.
GROUP_ID User group ID.
BUY Flag (Y/N) specifying one of the following:
  • "Y" - users of this group can purchase products at prices of this type;
  • "N" - users of this group can view prices of this type.

Example



<?
// Print ID's of price types
// at which users of the group 2 can purchase products
$db_res = CCatalogGroup::GetGroupsList(array("GROUP_ID"=>2, "BUY"=>"Y"));
while ($ar_res = $db_res->Fetch())
{
   echo $ar_res["CATALOG_GROUP_ID"].", ";
}
?>