You are here

public function ValueConvertTrait::convert in Views OAI-PMH 8

1 call to ValueConvertTrait::convert()
Record::populateRow in src/Plugin/views/style/Record.php
Return a formatted row value in array with all values as cartesian product of rows

File

src/Service/ValueConvertTrait.php, line 20

Class

ValueConvertTrait

Namespace

Drupal\views_oai_pmh\Service

Code

public function convert($currentValue, $newValue) {
  $output = [];
  if (is_array($currentValue)) {
    foreach ($currentValue as $id => $value) {
      $output[] = $value;
    }
  }
  else {
    $output[] = $currentValue;
  }
  $output[] = $newValue;
  return $output;
}