You are here

protected function TableRowSpan::getDeepestRows in Views Table Rowspan 8

Get deepest rows in a group.

Parameters

array $set: View grouping set.

1 call to TableRowSpan::getDeepestRows()
TableRowSpan::getColSpanRows in src/Plugin/views/style/TableRowSpan.php
Convert grouping sets into table rows.

File

src/Plugin/views/style/TableRowSpan.php, line 104

Class

TableRowSpan
Style plugin to merge duplicate row in table.

Namespace

Drupal\views_table_rowspan\Plugin\views\style

Code

protected function getDeepestRows($set) {
  $row = reset($set['rows']);

  // Check set is a group or a row.
  if (is_array($row) && isset($row['group'])) {
    $result = [];
    foreach ($set['rows'] as $sub_set) {
      $subset_result = $this
        ->getDeepestRows($sub_set);
      $result += $subset_result;
    }
    return $result;
  }
  else {
    $_result = [];
    foreach ($set['rows'] as $row_index => $row) {
      $_result[$row_index] = $row;
    }
    return $_result;
  }
}