PHP Класс GP_Translation, GlotPress-WP

Наследование: extends GP_Thing
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$date_added string Date when the translation was added.
$date_modified string Date when the translation was modified.
$field_names array List of field names for a translation.
$found_rows integer Number of found results.
$id integer ID of the translation.
$int_fields array List of field names which have an integer value.
$non_updatable_attributes array List of field names which cannot be updated.
$number_of_plural_translations integer Number of supported translations per original.
$original_id integer ID of the original.
$per_page integer Number of translations per page.
$status string Status of the translation.
$statuses array List of valid statuses.
$table_basename string Name of the database table.
$translation_0 string Translation for a singular form.
$translation_1 string Translation for a plural form.
$translation_2 string Translation for a second plural form.
$translation_3 string Translation for a third plural form.
$translation_4 string Translation for a fourth plural form.
$translation_5 string Translation for a fifth plural form.
$translation_set_id integer ID of the translation set.
$user_id integer ID of a user who submitted the translation.
$user_id_last_modified integer ID of a user (validator) who last changed the status of the translation.
$warnings array List of warnings when translation isn't correct.

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

Метод Описание
after_create ( ) : boolean Executes after creating a translation.
after_delete ( ) : boolean Executes after deleting a translation.
after_save ( ) : boolean Executes after saving a translation.
create ( $args )
fix_translation ( $translation )
for_export ( $project, $translation_set, $filters = null )
for_translation ( $project, $translation_set, $page, $filters = [], $sort = [] )
last_modified ( $translation_set )
normalize_fields ( array $args ) : array Normalizes an array with key-value pairs representing a GP_Translation object.
prepare_fields_for_save ( $args )
reject ( )
restrict_fields ( GP_Validation_Rules $rules ) Sets restriction rules for fields.
set_as_current ( )
set_fields ( $db_object )
set_status ( $status )
translations ( )

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

after_create() публичный Метод

Executes after creating a translation.
С версии: 1.0.0
public after_create ( ) : boolean
Результат boolean

after_delete() публичный Метод

Executes after deleting a translation.
С версии: 2.0.0
public after_delete ( ) : boolean
Результат boolean

after_save() публичный Метод

Executes after saving a translation.
С версии: 1.0.0
public after_save ( ) : boolean
Результат boolean

create() публичный Метод

public create ( $args )

fix_translation() публичный Метод

public fix_translation ( $translation )

for_export() публичный Метод

public for_export ( $project, $translation_set, $filters = null )

for_translation() публичный Метод

public for_translation ( $project, $translation_set, $page, $filters = [], $sort = [] )

last_modified() публичный Метод

public last_modified ( $translation_set )

normalize_fields() публичный Метод

Normalizes an array with key-value pairs representing a GP_Translation object.
С версии: 1.0.0
public normalize_fields ( array $args ) : array
$args array Arguments for a GP_Translation object.
Результат array Normalized arguments for a GP_Translation object.

prepare_fields_for_save() публичный Метод

public prepare_fields_for_save ( $args )

reject() публичный Метод

public reject ( )

restrict_fields() публичный Метод

Sets restriction rules for fields.
С версии: 1.0.0
public restrict_fields ( GP_Validation_Rules $rules )
$rules GP_Validation_Rules The validation rules instance.

set_as_current() публичный Метод

public set_as_current ( )

set_fields() публичный Метод

public set_fields ( $db_object )

set_status() публичный Метод

public set_status ( $status )

translations() публичный Метод

public translations ( )

Описание свойств

$date_added публичное свойство

Date when the translation was added.
public string $date_added
Результат string

$date_modified публичное свойство

Date when the translation was modified.
public string $date_modified
Результат string

$field_names публичное свойство

List of field names for a translation.
public array $field_names
Результат array

$found_rows публичное свойство

Number of found results.
public int $found_rows
Результат integer

$id публичное свойство

ID of the translation.
public int $id
Результат integer

$int_fields публичное свойство

List of field names which have an integer value.
public array $int_fields
Результат array

$non_updatable_attributes публичное свойство

List of field names which cannot be updated.
public array $non_updatable_attributes
Результат array

$number_of_plural_translations публичное статическое свойство

Number of supported translations per original.
public static int $number_of_plural_translations
Результат integer

$original_id публичное свойство

ID of the original.
public int $original_id
Результат integer

$per_page публичное свойство

Number of translations per page.
public int $per_page
Результат integer

$status публичное свойство

Status of the translation.
public string $status
Результат string

$statuses публичное статическое свойство

List of valid statuses.
public static array $statuses
Результат array

$table_basename публичное свойство

Name of the database table.
public string $table_basename
Результат string

$translation_0 публичное свойство

Translation for a singular form.
public string $translation_0
Результат string

$translation_1 публичное свойство

Translation for a plural form.
public string $translation_1
Результат string

$translation_2 публичное свойство

Translation for a second plural form.
public string $translation_2
Результат string

$translation_3 публичное свойство

Translation for a third plural form.
public string $translation_3
Результат string

$translation_4 публичное свойство

Translation for a fourth plural form.
public string $translation_4
Результат string

$translation_5 публичное свойство

Translation for a fifth plural form.
public string $translation_5
Результат string

$translation_set_id публичное свойство

ID of the translation set.
public int $translation_set_id
Результат integer

$user_id публичное свойство

ID of a user who submitted the translation.
public int $user_id
Результат integer

$user_id_last_modified публичное свойство

ID of a user (validator) who last changed the status of the translation.
С версии: 2.1.0
public int $user_id_last_modified
Результат integer

$warnings публичное свойство

List of warnings when translation isn't correct.
public array $warnings
Результат array