You are here

public function LanguageKeyValueItem::setValue in Lingotek Translation 3.4.x

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

Overrides \Drupal\Core\TypedData\TypedData::setValue().

Parameters

array|null $values: An array of property values.

bool $notify: (optional) Whether to notify the parent object of the change. Defaults to TRUE. If a property is updated from a parent object, set it to FALSE to avoid being notified again.

Overrides FieldItemBase::setValue

File

src/Plugin/Field/FieldType/LanguageKeyValueItem.php, line 87

Class

LanguageKeyValueItem
Plugin implementation of the 'language_key_value' field type.

Namespace

Drupal\lingotek\Plugin\Field\FieldType

Code

public function setValue($values, $notify = TRUE) {
  if (is_object($values['language'])) {
    $values['language'] = $values['language']
      ->getId();
  }
  parent::setValue($values, $notify);
}