trait I18nQueryTrait (View source)

Gets an i18n translation from the source database.

Properties

protected string $i18nStringTable

The i18n string table name.

Methods

bool
getPropertyNotInRowTranslation(Row $row, string $property_not_in_row, string $object_id_name, MigrateIdMapInterface $id_map)

Gets the translation for the property not already in the row.

Details

protected bool getPropertyNotInRowTranslation(Row $row, string $property_not_in_row, string $object_id_name, MigrateIdMapInterface $id_map)

Gets the translation for the property not already in the row.

For some i18n migrations there are two translation values, such as a translated title and a translated description, that need to be retrieved. Since these values are stored in separate rows of the i18nStringTable table we get them individually, one in the source plugin query() and the other in prepareRow(). The names of the properties varies, for example, in BoxTranslation they are 'body' and 'title' whereas in MenuLinkTranslation they are 'title' and 'description'. This will save both translations to the row.

Parameters

Row $row

The current migration row which must include both a 'language' property and an 'objectid' property. The 'objectid' is the value for the 'objectid' field in the i18n_string table.

string $property_not_in_row

The name of the property to get the translation for.

string $object_id_name

The value of the objectid in the i18n table.

MigrateIdMapInterface $id_map

The ID map.

Return Value

bool

FALSE if the property has already been migrated.

Exceptions

MigrateException