Drupal 8  8.0.2
FieldTranslationSynchronizer Class Reference
Inheritance diagram for FieldTranslationSynchronizer:

Public Member Functions

 __construct (EntityManagerInterface $entityManager)
 
 synchronizeItems (array &$values, array $unchanged_items, $sync_langcode, array $translations, array $columns)
 
- Public Member Functions inherited from FieldTranslationSynchronizerInterface
 synchronizeFields (ContentEntityInterface $entity, $sync_langcode, $original_langcode=NULL)
 

Protected Member Functions

 itemHash (array $items, $delta, array $columns)
 

Protected Attributes

 $entityManager
 

Detailed Description

Provides field translation synchronization capabilities.

Constructor & Destructor Documentation

__construct ( EntityManagerInterface  $entityManager)

Constructs a FieldTranslationSynchronizer object.

Parameters
\Drupal\Core\Entity\EntityManagerInterface$entityManagerThe entity manager.

References Drupal\entityManager().

Here is the call graph for this function:

Member Function Documentation

itemHash ( array  $items,
  $delta,
array  $columns 
)
protected

Computes a hash code for the specified item.

Parameters
array$itemsAn array of field items.
int$deltaThe delta identifying the item to be processed.
array$columnsAn array of column names to be synchronized.
Returns
string A hash code that can be used to identify the item.

Referenced by FieldTranslationSynchronizer\synchronizeItems().

Here is the caller graph for this function:

synchronizeItems ( array &  $values,
array  $unchanged_items,
  $sync_langcode,
array  $translations,
array  $columns 
)

{Synchronize the items of a single field.All the column values of the "active" language are compared to the unchanged values to detect any addition, removal or change in the items order. Subsequently the detected changes are performed on the field items in other available languages.

Parameters
array$field_valuesThe field values to be synchronized.
array$unchanged_itemsThe unchanged items to be used to detect changes.
string$sync_langcodeThe language code of the items to use as source values.
array$translationsAn array of all the available language codes for the given field.
array$columnsAn array of column names to be synchronized.
}

Implements FieldTranslationSynchronizerInterface.

References FieldTranslationSynchronizer\itemHash().

Here is the call graph for this function:


The documentation for this class was generated from the following file: