You are here

public function DraggableViews::getAncestor in DraggableViews 8

Same name and namespace in other branches
  1. 2.0.x 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;
}