You are here

protected function Record::getResultRows in Views OAI-PMH 8

Get result that view expose as cartesian product removing duplicates tuples

Return value

array

1 call to Record::getResultRows()
Record::render in src/Plugin/views/style/Record.php
Render the display in this style.

File

src/Plugin/views/style/Record.php, line 267

Class

Record
Plugin annotation @ViewsStyle( id = "views_oai_pmh_record", title = @Translation("OAI-PMH"), help = @Translation("Displays rows in OAI-PMH records."), display_types = {"oai_pmh"} )

Namespace

Drupal\views_oai_pmh\Plugin\views\style

Code

protected function getResultRows() : array {
  $rows = [];
  foreach ($this->view->result as $row_id => $row) {
    $this->view->row_index = $row_id;
    $item = $this
      ->populateRow($row_id, $row);
    $id = $row->_entity
      ->id();
    if (key_exists($id, $rows)) {
      $rows[$id] = array_merge_recursive($rows[$id], $item);
    }
    else {
      $rows[$id] = $item;
    }
  }

  //$rows = $this->removeDuplicates($rows);
  return $rows;
}