Method | Description | |
---|---|---|
__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. |
Method | Description | |
---|---|---|
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. |
public __construct ( Inpsyde\MultilingualPress\Database\Table $table ) | ||
$table | Inpsyde\MultilingualPress\Database\Table | Site relations table object. |
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. |