You are here

public function DraggableViews::getAncestor in DraggableViews 2.0.x

Same name and namespace in other branches
  1. 8 src/DraggableViews.php \Drupal\draggableviews\DraggableViews::getAncestor()

Get ancestor by index.

File

src/DraggableViews.php, line 73

Class

DraggableViews
Class DraggableViews.

Namespace

Drupal\draggableviews

Code

public function getAncestor($index) {
  $row = $this->view->result[$index];
  return !empty($row->draggableviews_structure_parent) ? $this
    ->getAncestor($this
    ->getIndex($row->draggableviews_structure_parent)) : $index;
}