public function draggableviews_hierarchy_handler::get_index in DraggableViews 7.2
Get "results" array index of and item with specific base field id.
Parameters
object $view: Views object
type $id: Base field id.
Return value
int
1 call to draggableviews_hierarchy_handler::get_index()
File
- handlers/
draggableviews_hierarchy_handler.inc, line 65 - Base plugin implementation.
Class
- draggableviews_hierarchy_handler
- Parent class for all hierarchy handlers.
Code
public function get_index($view, $id) {
foreach ($view->result as $key => $item) {
if ($item->{$view->base_field} == $id) {
return $key;
}
}
}