protected function ActivityOverviewBlock::getCommentsCount in Open Social 8.8
Same name and namespace in other branches
- 8.9 modules/social_features/social_landing_page/src/Plugin/Block/ActivityOverviewBlock.php \Drupal\social_landing_page\Plugin\Block\ActivityOverviewBlock::getCommentsCount()
- 8 modules/social_features/social_landing_page/src/Plugin/Block/ActivityOverviewBlock.php \Drupal\social_landing_page\Plugin\Block\ActivityOverviewBlock::getCommentsCount()
- 8.2 modules/social_features/social_landing_page/src/Plugin/Block/ActivityOverviewBlock.php \Drupal\social_landing_page\Plugin\Block\ActivityOverviewBlock::getCommentsCount()
- 8.3 modules/social_features/social_landing_page/src/Plugin/Block/ActivityOverviewBlock.php \Drupal\social_landing_page\Plugin\Block\ActivityOverviewBlock::getCommentsCount()
- 8.4 modules/social_features/social_landing_page/src/Plugin/Block/ActivityOverviewBlock.php \Drupal\social_landing_page\Plugin\Block\ActivityOverviewBlock::getCommentsCount()
- 8.5 modules/social_features/social_landing_page/src/Plugin/Block/ActivityOverviewBlock.php \Drupal\social_landing_page\Plugin\Block\ActivityOverviewBlock::getCommentsCount()
- 8.6 modules/social_features/social_landing_page/src/Plugin/Block/ActivityOverviewBlock.php \Drupal\social_landing_page\Plugin\Block\ActivityOverviewBlock::getCommentsCount()
- 8.7 modules/social_features/social_landing_page/src/Plugin/Block/ActivityOverviewBlock.php \Drupal\social_landing_page\Plugin\Block\ActivityOverviewBlock::getCommentsCount()
- 10.3.x modules/social_features/social_landing_page/src/Plugin/Block/ActivityOverviewBlock.php \Drupal\social_landing_page\Plugin\Block\ActivityOverviewBlock::getCommentsCount()
- 10.0.x modules/social_features/social_landing_page/src/Plugin/Block/ActivityOverviewBlock.php \Drupal\social_landing_page\Plugin\Block\ActivityOverviewBlock::getCommentsCount()
- 10.1.x modules/social_features/social_landing_page/src/Plugin/Block/ActivityOverviewBlock.php \Drupal\social_landing_page\Plugin\Block\ActivityOverviewBlock::getCommentsCount()
- 10.2.x modules/social_features/social_landing_page/src/Plugin/Block/ActivityOverviewBlock.php \Drupal\social_landing_page\Plugin\Block\ActivityOverviewBlock::getCommentsCount()
Get total count of comments.
1 call to ActivityOverviewBlock::getCommentsCount()
- ActivityOverviewBlock::build in modules/
social_features/ social_landing_page/ src/ Plugin/ Block/ ActivityOverviewBlock.php - Builds and returns the renderable array for this block plugin.
File
- modules/
social_features/ social_landing_page/ src/ Plugin/ Block/ ActivityOverviewBlock.php, line 336
Class
- ActivityOverviewBlock
- Provides a 'ActivityOverviewBlock' block.
Namespace
Drupal\social_landing_page\Plugin\BlockCode
protected function getCommentsCount() {
// Count both comment and post_comment type.
$query = $this->connection
->select('comment_field_data', 'c');
$query
->addExpression('COUNT(*)');
$query
->condition('c.status', 1);
return $query
->execute()
->fetchField();
}