You are here

function image_attach_views_handler_filter_iid_exist in Image 5.2

Same name and namespace in other branches
  1. 5 contrib/image_attach/image_attach.module \image_attach_views_handler_filter_iid_exist()

Views handler for filtering whether or not the node has an attached image.

1 string reference to 'image_attach_views_handler_filter_iid_exist'
image_attach_views_tables in contrib/image_attach/image_attach.module
Implementation of hook_views_tables().

File

contrib/image_attach/image_attach.module, line 420
image_attach.module

Code

function image_attach_views_handler_filter_iid_exist($op, $filter, $filterdata, &$query) {
  switch ($op) {
    case 'handler':
      $query
        ->ensure_table('image_attach');
      if ($filter['value']) {
        $query
          ->add_where('image_attach.iid IS NOT NULL');
      }
      else {
        $query
          ->add_where('image_attach.iid IS NULL');
      }
      break;
  }
}