You are here

private function OneOfSeveralValidationRule::getFieldColumnValue in Field Validation 8

1 call to OneOfSeveralValidationRule::getFieldColumnValue()
OneOfSeveralValidationRule::validate in src/Plugin/FieldValidationRule/OneOfSeveralValidationRule.php

File

src/Plugin/FieldValidationRule/OneOfSeveralValidationRule.php, line 129

Class

OneOfSeveralValidationRule
OneOfSeveralValidationRule

Namespace

Drupal\field_validation\Plugin\FieldValidationRule

Code

private function getFieldColumnValue($items, $column = 'value') : array {
  $field_values = [];
  foreach ($items as $delta => $item) {
    if ($item instanceof StringItem) {
      $item = $item
        ->getValue();
    }
    if (isset($item[$column]) && $item[$column] != '') {
      $field_values[] = $item[$column];
    }
  }
  return $field_values;
}