I have a paragraph type
my_paragraph which is attached to a node type
my_content_type on multiple fields like
field_d. I want to load only those attached to some specific fields, let's say
field_c. I am using
entityQuery, but open to other suggestions.
The entity/field structure is like:
my_content_type: Node |_ field_a: Paragraph (type: my_paragraph) |_ field_b: Paragraph (type: my_paragraph) |_ field_c: Paragraph (type: my_paragraph) |_ field_d: Paragraph (type: my_paragraph)
My code which loads all paragraphs of type:
\Drupal::entityQuery('paragraph') ->condition('type', 'my_paragraph') // Here I want to filter by the field name on the parent entity ->condition('PARENT_FIELD', ['field_a', 'field_c'], 'IN') // Some more conditions out of context ->condition('out_of_context_field', $out_of_context_value) ->execute();
Is there any entity query condition I can use here?