Skip to content

Drupal\helper\Field

Provides helpers for working with field values.

Methods

Name Description
getDuplicateValues Finds duplicate field values.

Field::getDuplicateValues

Description

public static getDuplicateValues (\Drupal\Core\Field\FieldItemListInterface $items, string $property)

Finds duplicate field values.

Parameters

  • (\Drupal\Core\Field\FieldItemListInterface) $items : The field list class.
  • (string) $property : The field item property to use. Defaults to mainPropertyName() on the
    field class if not provided.

Return Values

array

An array of duplicate field values.