Last active
August 24, 2017 18:00
-
-
Save suresh-kumara-gist/4493fa7bc0d02edaeb3ba7a82484c7a1 to your computer and use it in GitHub Desktop.
Drupal 8 Entity aggregate Query group by
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $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