I am attempting to make use of entityQuery in Drupal 8 to carry out an “and” inside an “or” group. A simplified model of what I am attempting to do is that this: Question for all apples, oranges and bananas which are ripe. Drupal Development code I might like to have the ability to use would appear like this:
$oQuery = Drupal::entityQuery('node'); $oOrGroup = $oQuery->orConditionGroup(); $oOrGroup->situation('kind',['apple','orange'],'IN'); $oAndGroup = $oOrGroup->andConditionGroup(); $aAndGroup->situation('kind','banana') ->situation('field_ripe',1); $oOrGroup->situation($oAndGroup); $oQuery->situation($oOrGroup);
Nonetheless this does not work as a result of andConditionGroup() is not a way of ConditionInterface.
Is there a means to do that with entityQuery or do I’ve to revert to utilizing db_query()?