Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save suresh-kumara-gist/4493fa7bc0d02edaeb3ba7a82484c7a1 to your computer and use it in GitHub Desktop.
Save suresh-kumara-gist/4493fa7bc0d02edaeb3ba7a82484c7a1 to your computer and use it in GitHub Desktop.
Drupal 8 Entity aggregate Query group by
$query = \Drupal::entityQueryAggregate('group_content')
->condition('type', 'section-group_node-session', '=')
->condition('entity_id.entity.field_session_from_time1', $startdaydate, '>=')
->condition('entity_id.entity.field_session_to_time1',$endaydate, '<=')
->groupBy('gid');
// result we will get group by field values not group_content entity ids
$result = $query->execute();
dpm($result);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment