Skip to main content
Category:

How to load comment ids using the comment type in Drupal 8 & 9

 

Example How to load comment ids using the comment type in Drupal 8 & 9.

 

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

Riadh Rahmi

Senior Web Developer PHP/Drupal & Laravel

I am a senior web developer, I have experience in planning and developing large scale dynamic web solutions especially in Drupal & Laravel.

Web Posts

Search

Page Facebook