PHP Класс Inpsyde\MultilingualPress\API\WPDBLanguages

С версии: 3.0.0
Наследование: implements Inpsyde\MultilingualPress\API\Languages
Показать файл Открыть проект

Открытые методы

Метод Описание
__construct ( Inpsyde\MultilingualPress\Database\Table $table ) Constructor. Sets up the properties.
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.

Приватные методы

Метод Описание
extract_field_specifications_from_table ( Inpsyde\MultilingualPress\Database\Table $table ) : string[] Returns an array with column names as keys and the individual printf conversion specification as value.
get_field_specifications ( array $language ) : array Returns an array with the according specifications for all fields included in the given language.
get_fields ( array $args ) : string Returns the according string with all valid fields included in the given arguments, or '*' if none.
get_limit ( array $args ) : string Returns the according LIMIT string for the number and page values included in the given arguments.
get_order_by ( array $args ) : string Returns the according ORDER BY string for all valid fields included in the given arguments.
get_where ( array $args ) : string Returns the according WHERE string for all valid conditions included in the given arguments.
is_array_with_valid_field ( mixed $maybe_array ) : boolean Checks if the given element is an array that has a valid field element.

Описание методов

__construct() публичный метод

Constructor. Sets up the properties.
С версии: 3.0.0
public __construct ( Inpsyde\MultilingualPress\Database\Table $table )
$table Inpsyde\MultilingualPress\Database\Table Site relations table object.

get_all_languages() публичный метод

Returns an array with objects of all available languages.
С версии: 3.0.0
public get_all_languages ( ) : object[]
Результат object[] The array with objects of all available languages.

get_language_by_http_code() публичный метод

Returns the desired field value of the language with the given HTTP code.
С версии: 3.0.0
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.
Результат string | string[] The desired field value, an empty string on failure, or an array for field 'all'.

get_languages() публичный метод

Returns all languages according to the given arguments.
С версии: 3.0.0
public get_languages ( array $args = [] ) : object[]
$args array Arguments.
Результат object[] The array with objects of all languages according to the given arguments.

update_languages_by_id() публичный метод

Updates the given languages.
С версии: 3.0.0
public update_languages_by_id ( array $languages ) : integer
$languages array An array with language IDs as keys and one or more fields as values.
Результат integer The number of updated languages.