You are here

protected function DraggableViewsSort::splitViewSortDataOptions in DraggableViews 2.0.x

Split data into view/display ids.

1 call to DraggableViewsSort::splitViewSortDataOptions()
DraggableViewsSort::query in src/Plugin/views/sort/DraggableViewsSort.php
Called to add the sort to a query.

File

src/Plugin/views/sort/DraggableViewsSort.php, line 190

Class

DraggableViewsSort
Basic sort handler for Draggableviews Weight.

Namespace

Drupal\draggableviews\Plugin\views\sort

Code

protected function splitViewSortDataOptions($data) {
  if (empty($data) || $data == "this") {
    return [
      $this->view
        ->id(),
      $this->view->current_display,
    ];
  }
  $explode = explode(":", $data);
  if (count($explode) != 2) {
    return [
      "",
      "",
    ];
  }
  return $explode;
}