You are here

function _webform_view_find_id in Webform 7.4

Helper; Finds an item by option.

1 call to _webform_view_find_id()
webform_views_pre_view in views/webform.views.inc
Implements hook_view_pre_view().

File

views/webform.views.inc, line 618
Views hooks implemented for the Webform module.

Code

function _webform_view_find_id($view, $display_id, $type, $options) {
  foreach ($view
    ->get_items($type, $display_id) as $id => $item) {
    foreach ($options as $option_key => $option_value) {
      if ($item[$option_key] != $option_value) {
        continue 2;
      }
    }
    return $id;
  }
  return NULL;
}