GetByID
This class has been deprecated. It's recommended to use methods of class Bitrix\Sale\Location.
array CSaleLocation::GetByID( int ID, string strLang = LANGUAGE_ID );
The method GetByID returns parameters of a specified location. The returned information includes country and city parameters. Language-dependent parameters are returned for the language specified in the second parameter.
Parameters
Parameter | Description |
---|---|
ID | The location ID. |
strLang | The ID of the language in which the language-dependent parameters will be returned. By default, the current language is used. |
Returned values
Returns an associated array with the following keys.
Key | Description |
---|---|
ID | The location ID. |
COUNTRY_ID | The country ID. |
CITY_ID | The city ID. |
SORT | Sort weight. |
COUNTRY_NAME_ORIG | Language-independent country name. |
COUNTRY_SHORT_NAME | Short language-independent country name abbreviation. |
COUNTRY_NAME_LANG | Language-dependent country name. |
CITY_NAME_ORIG | Language-independent city name. |
CITY_SHORT_NAME | Short language-independent city name abbreviation. |
CITY_NAME_LANG | Language-dependent city name. |
COUNTRY_NAME | Language-dependent country name (if exists, or language-independent country name otherwise). |
CITY_NAME | Language-dependent country name (if exists, or language-independent country name otherwise). |
Example
<? $arLocs = CSaleLocation::GetByID(22, LANGUAGE_ID); echo $arLocs["COUNTRY_NAME"]." - ".$arLocs["CITY_NAME"]; ?>
© «Bitrix24», 2001-2024