Problem/Motivation
Add an optional WHERE condition to MIN/MAX to enable narrowing down the results within the subquery.
Example:
$webformQuery = \Drupal::service('webform_query');
$results = $webformQuery->addCondition('webform_id', ['webform_one', 'webform_two', 'webform_three'], 'IN', 'webform_submission')
->addCondition('uid', 1, '=', 'webform_submission')
->addMinMax('MAX', 'webform_submission', 'webform_id', ['uid', '=', '1']) // MAX sid in webform_submission table, where UID = 1, grouped by webform ID.
->orderBy('created', 'ASC', 'webform_submission')
->processQuery()->fetchCol();
Comments
Comment #2
imclean commentedComment #3
imclean commentedComment #4
imclean commentedComment #5
imclean commentedComment #7
imclean commented