You are here

trait ValueConvertTrait in Views OAI-PMH 8

Hierarchy

1 file declares its use of ValueConvertTrait
Record.php in src/Plugin/views/style/Record.php

File

src/Service/ValueConvertTrait.php, line 8

Namespace

Drupal\views_oai_pmh\Service
View source
trait ValueConvertTrait {

  /**
   *
   */
  public function __construct() {
  }

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

}

Members