You are here

protected function SourceCsvForm::getLabel in Migrate Tools 8.4

Gets the label for a given property from a column_names array.

Parameters

array $column_names: An array of column_names.

string $property_name: The property name to find a label for.

Return value

string The label for this property.

1 call to SourceCsvForm::getLabel()
SourceCsvForm::buildForm in src/Form/SourceCsvForm.php
Form constructor.

File

src/Form/SourceCsvForm.php, line 436

Class

SourceCsvForm
Provides an edit form for CSV source plugin column_names configuration.

Namespace

Drupal\migrate_tools\Form

Code

protected function getLabel(array $column_names, $property_name) {
  $label = '';
  foreach ($column_names as $column) {
    foreach ($column as $key => $value) {
      if ($key === $property_name) {
        $label = $value;
        break;
      }
    }
  }
  return $label;
}