Untitled

mail@pastecode.io avatar
unknown
plain_text
5 months ago
557 B
2
Indexable
/**
 * Implements hook_entity_query_alter().
 */
function your_module_name_entity_query_alter(\Drupal\Core\Entity\Query\QueryInterface $query) {
  // Get the context for the query.
  $entity_type = $query->getEntityTypeId();
  $conditions = $query->getConditions();

  // Check if the entity type is 'node' and the field is 'field_meeting'.
  if ($entity_type === 'node' && isset($conditions['field_meeting_type_target_id'])) {
    // Add condition to filter by 'field_meeting_type' value 'nexus'.
    $query->condition('field_meeting_type', 'nexus');
  }
}
Leave a Comment