Experimental project

This is a sandbox project, which contains experimental code for developer use only.

EntityFieldQuery Meta SQL is a tiny module that lets you execute methods on query objects by registering them to the query metadata system. This allows modules to make full use of the SQL capabilities even if they have to interact with an EntityFieldQuery instance.

Example usage:

/**
 * Custom filter handler for views to filter for, or filer out 'empty' values.
 */
class example_handler_filter_has_value extends views_handler_filter_boolean_operator {
  function query() {
    if (empty($this->value)) {
      $this->query->query->addTag('efq_meta_sql');
      $this->query->query->addMetaData('efq_meta_sql', array('isNull' => array('example_field')));
    }
    else {
      $this->query->query->addTag('efq_meta_sql');
      $this->query->query->addMetaData('efq_meta_sql', array('isNotNull' => array('example_field')));
    }
  }
}

The example above defines a custom filter handler for views which can be used in combination with efq_views.

Project information