Drupal developer at GO1 with 2 years experiences.
$query = new EntityFieldQuery();
$query->entityCondition('entity_type',
'node')
->entityCondition('bundle',
'book')
->propertyCondition('status',
'published')
->fieldCondition('field_price',
'value', 100)
->fieldOrderBy('field_no_pages',
'value', 'DESC')
->propertyOrderBy('uid');
$result = $query->execute();
$query = new EntityFieldJoinQuery();
$query
->entityCondition('entity_type', 'node')
->entityCondition('bundle', 'book')
// Uploaded by authenticated users.
->propertyCondition(
'author.entity.{users_roles}.rid',
DRUPAL_AUTHENTICATED_RID)
->fieldCondition(
'field_author.entity.field_name',
'value', 'J. K. Rowling')
->fieldOrderBy(
'field_publisher.entity.field_name',
'value', 'ASC')
->propertyOrderBy(
'field_co_writer.entity.age',
'value', 'DESC');
$result = $query->execute();
$query = new EntityFieldJoinQuery();
$query
->entityCondition('entity_type', 'user')
->propertyCondition('{og_membership}.type',
'silver')
->propertyCondition(
'{og_membership}.group<club>.field_name',
'Let Dance');
$result = $query->execute();
$query = new EntityFieldJoinQuery();
$query
->entityCondition('entity_type', 'user')
->propertyCondition(
'{og_membership}.group<course>.' .
'{og_membership(required)}.' .
'group<major>.field_name',
'Information Technology');
$result = $query->execute();
/**
* Implements hook_ctools_plugin_directory().
*/
function MODULE_ctools_plugin_directory
($module, $plugin) {
if (($module == 'entity_field_join_query') &&
($plugin == 'efjq_join_part')) {
return 'plugins/efjq_join_part';
}
}
$plugin = array(
'title' => t('My Plugin'),
'handler' => array(
'class' => 'efjq_join_part_my_plugin',
),
// Plugin with lower weight will
// override plugin with hight weight.
'weight' => 2,
);
class efjq_join_part_my_plugin extends
efjq_join_part_base {
//...
}