Documentation

GetList

CSite::GetList(
 string &by = "sort",
 string &order = "asc",
 array filter = array()
)

The method returns the list of sites as an object of CLangDBResult class. Static method.

Parameters

ParameterDescription
by Specifies the field for sorting. The following values are possible:
  • id - by the site ID;
  • active - active state flag;
  • name - site short name;
  • dir - root directory of the site content;
  • lendir - length of the name of the site content root directory;
  • def - "Default site" flag;
  • sort - sorting weight;
Optional parameter. "Sort" by default.
оrder Sorting order. The following values are possible:
  • asc - by ascension
  • desc - by descension
Optional parameter. "Asc" by default.
filter An array of the array("filtered field"=>"value" [, ...]) format. "Filtered field" can have the following values:
  • ID - site ID;
  • NAME - the "Name" field of the site settings;
  • DOMAIN - the "Domain" field of the site settings;
  • IN_DIR - the "Site folder" field prefix of the site settings;
  • LANGUAGE_ID - double character ID of the site language;
  • ACTIVE - active state flag (Y|N);
  • DEFAULT - by default site (Y|N);

See Also

Examples of use

<?
$rsSites = CSite::GetList($by="sort", $order="desc", Array("NAME" => "www.mysite.com"));
while ($arSite = $rsSites->Fetch())
{
  echo "<pre>"; print_r($arSite); echo "</pre>";
}
?>


© «Bitrix24», 2001-2024