$or_group =
$query->
orConditionGroup();
$nested_or_group =
$query->
orConditionGroup();
$nested_or_group->
condition('colors', 'red', 'CONTAINS'
);
$nested_or_group->
condition('shapes', 'circle', 'CONTAINS'
);
$or_group->
condition($nested_or_group);
$nested_and_group =
$query->
andConditionGroup();
$nested_and_group->
condition('colors', 'yellow', 'CONTAINS'
);
$nested_and_group->
condition('shapes', 'square', 'CONTAINS'
);
$nested_and_group->
notExists('photo.alt'
);
$or_group->
condition($nested_and_group);
$query->
condition($or_group);
return [ [ [ 'or-group' =>
['group' =>
['conjunction' => 'OR'
]],
'nested-or-group' =>
['group' =>
['conjunction' => 'OR', 'memberOf' => 'or-group'
]],
'nested-and-group' =>
['group' =>
['conjunction' => 'AND', 'memberOf' => 'or-group'
]],
'condition-0' =>
[