PHP 클래스 Inpsyde\MultilingualPress\API\WPDBLanguages

부터: 3.0.0
상속: implements Inpsyde\MultilingualPress\API\Languages
파일 보기 프로젝트 열기: inpsyde/multilingual-press

공개 메소드들

메소드 설명
__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.