1

I have two types of content: Content A and Content B. Content B has an entity reference field that points to Content A.

My problem is that I am trying to check by code if Content B has a defined value that is a field of content A.

I tried something like this:

$query = \Drupal::entityQuery('node');
    $group = $query->orConditionGroup()
      ->condition('content_a.field_one', 'uno')
      ->condition('contnet_a.field_two', 'dos');

    $entity_ids = $query->condition('type', 'content_b')
      ->condition($group)
      ->execute();
  • 1
    My problem is that I am trying to check by code if Content B has a defined value that is a field of content A Maybe it's just me, but I don't get what you're trying to say here. – No Sssweat Jan 24 '19 at 10:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.