You are here

protected function ActivityOverviewBlock::getTopicsCount in Open Social 8.2

Same name and namespace in other branches
  1. 8.9 modules/social_features/social_landing_page/src/Plugin/Block/ActivityOverviewBlock.php \Drupal\social_landing_page\Plugin\Block\ActivityOverviewBlock::getTopicsCount()
  2. 8 modules/social_features/social_landing_page/src/Plugin/Block/ActivityOverviewBlock.php \Drupal\social_landing_page\Plugin\Block\ActivityOverviewBlock::getTopicsCount()
  3. 8.3 modules/social_features/social_landing_page/src/Plugin/Block/ActivityOverviewBlock.php \Drupal\social_landing_page\Plugin\Block\ActivityOverviewBlock::getTopicsCount()
  4. 8.4 modules/social_features/social_landing_page/src/Plugin/Block/ActivityOverviewBlock.php \Drupal\social_landing_page\Plugin\Block\ActivityOverviewBlock::getTopicsCount()
  5. 8.5 modules/social_features/social_landing_page/src/Plugin/Block/ActivityOverviewBlock.php \Drupal\social_landing_page\Plugin\Block\ActivityOverviewBlock::getTopicsCount()
  6. 8.6 modules/social_features/social_landing_page/src/Plugin/Block/ActivityOverviewBlock.php \Drupal\social_landing_page\Plugin\Block\ActivityOverviewBlock::getTopicsCount()
  7. 8.7 modules/social_features/social_landing_page/src/Plugin/Block/ActivityOverviewBlock.php \Drupal\social_landing_page\Plugin\Block\ActivityOverviewBlock::getTopicsCount()
  8. 8.8 modules/social_features/social_landing_page/src/Plugin/Block/ActivityOverviewBlock.php \Drupal\social_landing_page\Plugin\Block\ActivityOverviewBlock::getTopicsCount()
  9. 10.3.x modules/social_features/social_landing_page/src/Plugin/Block/ActivityOverviewBlock.php \Drupal\social_landing_page\Plugin\Block\ActivityOverviewBlock::getTopicsCount()
  10. 10.0.x modules/social_features/social_landing_page/src/Plugin/Block/ActivityOverviewBlock.php \Drupal\social_landing_page\Plugin\Block\ActivityOverviewBlock::getTopicsCount()
  11. 10.1.x modules/social_features/social_landing_page/src/Plugin/Block/ActivityOverviewBlock.php \Drupal\social_landing_page\Plugin\Block\ActivityOverviewBlock::getTopicsCount()
  12. 10.2.x modules/social_features/social_landing_page/src/Plugin/Block/ActivityOverviewBlock.php \Drupal\social_landing_page\Plugin\Block\ActivityOverviewBlock::getTopicsCount()

Get total count of topics.

1 call to ActivityOverviewBlock::getTopicsCount()
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 293

Class

ActivityOverviewBlock
Provides a 'ActivityOverviewBlock' block.

Namespace

Drupal\social_landing_page\Plugin\Block

Code

protected function getTopicsCount() {
  $query = $this->connection
    ->select('node_field_data', 'n');
  $query
    ->addExpression('COUNT(*)');
  $query
    ->condition('n.type', 'topic');
  $query
    ->condition('n.status', 1);
  return $query
    ->execute()
    ->fetchField();
}