22
April
Code to query for getting node according to field condition in DRUPAL 8
$query = \Drupal::entityQuery('node') ->condition('status', NODE_PUBLISHED) ->condition('type', 'custom_type'); $and = $query->andConditionGroup(); $and->condition('custom_taxonomy', 2); $query->condition($and); $and = $query->andConditionGroup(); $and->condition('custom_taxonomy', 8); $query->condition($and); $result = $query->execute();
© 2023.ZedAngle. All Rights Reserved.