Skip to main content
Removed Drupal version tag from title
Link
leymannx
  • 18.8k
  • 6
  • 72
  • 126

How tocan I load comment idsIDs using the comment type programmitically in drupal 8?

Source Link
Rifas Ali
  • 510
  • 3
  • 8
  • 19

How to load comment ids using comment type programmitically in drupal 8?

I know how to load comment ids for a particular node by following code

$entity_manager = \Drupal::entityTypeManager();
$cids = $entity_manager
    ->getStorage('comment')
    ->getQuery('AND')
    ->condition('entity_id', '25364')
    ->condition('entity_type', 'node')
    ->execute();

But I need one more condition to add on because this node might have multiple comment type linked. I know the machine name , but I don't know exactly what should be the first parameter to be passed in condition.