67 public static function getTypes($params = array(
'LANGUAGE_ID' => LANGUAGE_ID))
69 if(!is_array($params))
72 if(!isset($params[
'LANGUAGE_ID']))
73 $params[
'LANGUAGE_ID'] = LANGUAGE_ID;
77 $lang = mb_strtolower($params[
'LANGUAGE_ID']);
78 $langMapped = static::mapLanguage($lang);
80 $res = \Bitrix\Sale\Location\TypeTable::getList(array(
83 'TNAME' =>
'NAME.NAME',
84 'TLANGUAGE_ID' =>
'NAME.LANGUAGE_ID'
91 while($item = $res->fetch())
93 if(!isset($result[$item[
'CODE']]))
95 $result[$item[
'CODE']] = array(
96 'CODE' => $item[
'CODE'],
102 $result[$item[
'CODE']][
'NAME'][$item[
'TLANGUAGE_ID']] = $item[
'TNAME'];
105 foreach($result as $code => &$data)
107 if((
string) $data[
'NAME'][$lang] !=
'')
109 $name = $data[
'NAME'][$lang];
113 if((
string) $data[
'NAME'][$langMapped] !=
'')
114 $name = $data[
'NAME'][$langMapped];
116 $name = $data[
'NAME'][
'en'];
119 $data[
'NAME_CURRENT'] = $name;