Method | Description | |
---|---|---|
get_all_languages ( ) : object[] | Returns an array with objects of all available languages. | |
get_language_by_http_code ( string $http_code, string $field = 'native_name', string | string[] $fallbacks = ['native_name', 'english_name'] ) : string | string[] | Returns the desired field value of the language with the given HTTP code. | |
get_languages ( array $args = [] ) : object[] | Returns all languages according to the given arguments. | |
update_languages_by_id ( array $languages ) : integer | Updates the given languages. |
public get_all_languages ( ) : object[] | ||
return | object[] | The array with objects of all available languages. |
public get_language_by_http_code ( string $http_code, string $field = 'native_name', string | string[] $fallbacks = ['native_name', 'english_name'] ) : string | string[] | ||
$http_code | string | Language HTTP code. |
$field | string | Optional. The field which should be queried. Defaults to 'native_name'. |
$fallbacks | string | string[] | Optional. Falback language fields. Defaults to native and English name. |
return | string | string[] | The desired field value, an empty string on failure, or an array for field 'all'. |
public get_languages ( array $args = [] ) : object[] | ||
$args | array | Arguments. |
return | object[] | The array with objects of all languages according to the given arguments. |
public update_languages_by_id ( array $languages ) : integer | ||
$languages | array | An array with language IDs as keys and one or more fields as values. |
return | integer | The number of updated languages. |