Documentation

GetList

CDBResult
CSalePersonType::GetList(
 string &by,
 string &order,
 array arFilter = Array()
);

The method GetList returns an optionally sorted and filtered list of payer types.

Parameters

ParameterDescription
by Specifies the name of a parameter by which the sorting is to be performed. 

The following values are possible:
  • SORT - the payer type sort weight (default);
  • LID - the ID of the site owning the new payer type;
  • NAME - the payer type name;
  • ID - the payer type ID.
order Sort order. Can be one of the following:
  • ASC - ascending;
  • DESC - descending.
arFilter The filter is an associated array whose keys are the parameter names, and values are the conditions.

The following keys are possible:
  • LID - the ID of the site owning the new payer type;
  • NAME - the payer type name;
  • ID - the payer type ID

Returned values

Returns an instance of CDBResult, containing a set of associated arrays with the following keys.

Key Description
ID The payer type ID. 
LID The ID of the site owning the new payer type.
NAME The payer type name.
SORT The payer type sort weight.

Example


<?
// Display radio buttons allowing to select the payer type for the current site.
$db_ptype = CSalePersonType::GetList(($by="SORT"), 
                                     ($order="ASC"), 
                                     Array("LID"=>SITE_ID));
$bFirst = True;
while ($ptype = $db_ptype->Fetch())
{
   ?><input 
      type="radio" 
      name="PERSON_TYPE" 
      value="<?echo $ptype["ID"] ?>"
      <?if ($bFirst) echo " checked";?>><?echo $ptype["NAME"] ?><br><?
   $bFirst = False;
}
?>
© «Bitrix24», 2001-2024
Up