You are here

public function LingotekConfigurationService::setFieldPropertiesLingotekEnabled in Lingotek Translation 8

Same name and namespace in other branches
  1. 8.2 src/LingotekConfigurationService.php \Drupal\lingotek\LingotekConfigurationService::setFieldPropertiesLingotekEnabled()
  2. 4.0.x src/LingotekConfigurationService.php \Drupal\lingotek\LingotekConfigurationService::setFieldPropertiesLingotekEnabled()
  3. 3.0.x src/LingotekConfigurationService.php \Drupal\lingotek\LingotekConfigurationService::setFieldPropertiesLingotekEnabled()
  4. 3.1.x src/LingotekConfigurationService.php \Drupal\lingotek\LingotekConfigurationService::setFieldPropertiesLingotekEnabled()
  5. 3.2.x src/LingotekConfigurationService.php \Drupal\lingotek\LingotekConfigurationService::setFieldPropertiesLingotekEnabled()
  6. 3.3.x src/LingotekConfigurationService.php \Drupal\lingotek\LingotekConfigurationService::setFieldPropertiesLingotekEnabled()
  7. 3.4.x src/LingotekConfigurationService.php \Drupal\lingotek\LingotekConfigurationService::setFieldPropertiesLingotekEnabled()
  8. 3.5.x src/LingotekConfigurationService.php \Drupal\lingotek\LingotekConfigurationService::setFieldPropertiesLingotekEnabled()
  9. 3.6.x src/LingotekConfigurationService.php \Drupal\lingotek\LingotekConfigurationService::setFieldPropertiesLingotekEnabled()
  10. 3.7.x src/LingotekConfigurationService.php \Drupal\lingotek\LingotekConfigurationService::setFieldPropertiesLingotekEnabled()
  11. 3.8.x src/LingotekConfigurationService.php \Drupal\lingotek\LingotekConfigurationService::setFieldPropertiesLingotekEnabled()

Sets the configured properties of a field that are enabled for Lingotek translation.

Parameters

string $entity_type_id: The type of the entity.

string $bundle: The bundle of the entity.

string $field_name: The field of the bundle.

string[] $properties: Field properties that are enabled.

Overrides LingotekConfigurationServiceInterface::setFieldPropertiesLingotekEnabled

File

src/LingotekConfigurationService.php, line 240
Contains \Drupal\lingotek\LingotekConfigurationService.

Class

LingotekConfigurationService
Service for managing lingotek configuration.

Namespace

Drupal\lingotek

Code

public function setFieldPropertiesLingotekEnabled($entity_type_id, $bundle, $field_name, array $properties) {
  $config = \Drupal::configFactory()
    ->getEditable('lingotek.settings');
  $key = 'translate.entity.' . $entity_type_id . '.' . $bundle . '.field.' . $field_name . ':properties';
  $config
    ->set($key, $properties);
  $config
    ->save();
}