function ContentTranslationSynchronizedFieldsConstraintValidator::getSynchronizedPropertiesByField

Same name in other branches
  1. 9 core/modules/content_translation/src/Plugin/Validation/Constraint/ContentTranslationSynchronizedFieldsConstraintValidator.php \Drupal\content_translation\Plugin\Validation\Constraint\ContentTranslationSynchronizedFieldsConstraintValidator::getSynchronizedPropertiesByField()
  2. 10 core/modules/content_translation/src/Plugin/Validation/Constraint/ContentTranslationSynchronizedFieldsConstraintValidator.php \Drupal\content_translation\Plugin\Validation\Constraint\ContentTranslationSynchronizedFieldsConstraintValidator::getSynchronizedPropertiesByField()
  3. 11.x core/modules/content_translation/src/Plugin/Validation/Constraint/ContentTranslationSynchronizedFieldsConstraintValidator.php \Drupal\content_translation\Plugin\Validation\Constraint\ContentTranslationSynchronizedFieldsConstraintValidator::getSynchronizedPropertiesByField()

Returns the synchronized properties for every specified field.

Parameters

\Drupal\Core\Field\FieldDefinitionInterface[] $field_definitions: An array of field definitions.

Return value

string[][] An associative array of arrays of field property names keyed by field name.

1 call to ContentTranslationSynchronizedFieldsConstraintValidator::getSynchronizedPropertiesByField()
ContentTranslationSynchronizedFieldsConstraintValidator::validate in core/modules/content_translation/src/Plugin/Validation/Constraint/ContentTranslationSynchronizedFieldsConstraintValidator.php

File

core/modules/content_translation/src/Plugin/Validation/Constraint/ContentTranslationSynchronizedFieldsConstraintValidator.php, line 221

Class

ContentTranslationSynchronizedFieldsConstraintValidator
Checks that synchronized fields are handled correctly in pending revisions.

Namespace

Drupal\content_translation\Plugin\Validation\Constraint

Code

public function getSynchronizedPropertiesByField(array $field_definitions) {
    $synchronizer = $this->synchronizer;
    $synchronized_properties = array_filter(array_map(function (FieldDefinitionInterface $field_definition) use ($synchronizer) {
        return $synchronizer->getFieldSynchronizedProperties($field_definition);
    }, $field_definitions));
    return $synchronized_properties;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.