This project is not covered by Drupal’s security advisory policy.
Warning : This module abuses EntityFieldQuery to return data from your database. It does not work with entities or any modules that build on them.
It allows you to use addField within an EntityFieldQueryExtraFields object (extends EntityFieldQuery objects). Initially EntityFieldQuery only gives you back the entity id, bundle and entity type. This module adds an extra layer on top of that without doing some extra entity_loads! Important if you want to work with massive amounts of data and you want to reduce the sql queries. Since EFQ already queries the database for this information, why not alter that query to also give you some additional fields. This means that not a single extra query will be performed to get that data.
A word of caution, if you rely on some post-formatting/post-loading that happens in entity_load or similar functions, this module won't take care of that. You have to ensure the validity of the retrieved data yourselves.
Fetching the node title
$query = new EntityFieldQueryExtraFields(); $result = $query->entityCondition('entity_type', 'node') ->propertyCondition('type', 'my_bundle_type') ->propertyCondition('status', 1) ->addExtraField('field_myfield', value', value') ->addExtraField('field_mynodereffield', nid', nid') ->addExtraField('', 'title', 'title', 'node') ->fieldCondition('field_myfield', 'value', 'some_value_to_filter_on', '=') ->execute();
Possible combinations :
addExtraField($field_name, $column, $column_alias = NULL, $table = NULL)
Specify from which field the extra field should come. If it is from a base table, leave it empty and fill in the table argument
Specify the name of the column,
Specify the alias of the column,
Optionally, add something like node or user here (the base table),
- Maintenance status: Actively maintained
- Development status: Under active development
- Module categories: Database Drivers, Developer
- Reported installs: 1,003 sites currently report using this module. View usage statistics.
- Downloads: 8,091
- Last modified: December 2, 2014
- This project is not covered by the security advisory policy.
Use at your own risk! It may have publicly disclosed vulnerabilities.