You are here

protected function ActivityOverviewBlock::getUsersCount in Open Social 8.8

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::getUsersCount()
  2. 8 modules/social_features/social_landing_page/src/Plugin/Block/ActivityOverviewBlock.php \Drupal\social_landing_page\Plugin\Block\ActivityOverviewBlock::getUsersCount()
  3. 8.2 modules/social_features/social_landing_page/src/Plugin/Block/ActivityOverviewBlock.php \Drupal\social_landing_page\Plugin\Block\ActivityOverviewBlock::getUsersCount()
  4. 8.3 modules/social_features/social_landing_page/src/Plugin/Block/ActivityOverviewBlock.php \Drupal\social_landing_page\Plugin\Block\ActivityOverviewBlock::getUsersCount()
  5. 8.4 modules/social_features/social_landing_page/src/Plugin/Block/ActivityOverviewBlock.php \Drupal\social_landing_page\Plugin\Block\ActivityOverviewBlock::getUsersCount()
  6. 8.5 modules/social_features/social_landing_page/src/Plugin/Block/ActivityOverviewBlock.php \Drupal\social_landing_page\Plugin\Block\ActivityOverviewBlock::getUsersCount()
  7. 8.6 modules/social_features/social_landing_page/src/Plugin/Block/ActivityOverviewBlock.php \Drupal\social_landing_page\Plugin\Block\ActivityOverviewBlock::getUsersCount()
  8. 8.7 modules/social_features/social_landing_page/src/Plugin/Block/ActivityOverviewBlock.php \Drupal\social_landing_page\Plugin\Block\ActivityOverviewBlock::getUsersCount()
  9. 10.3.x modules/social_features/social_landing_page/src/Plugin/Block/ActivityOverviewBlock.php \Drupal\social_landing_page\Plugin\Block\ActivityOverviewBlock::getUsersCount()
  10. 10.0.x modules/social_features/social_landing_page/src/Plugin/Block/ActivityOverviewBlock.php \Drupal\social_landing_page\Plugin\Block\ActivityOverviewBlock::getUsersCount()
  11. 10.1.x modules/social_features/social_landing_page/src/Plugin/Block/ActivityOverviewBlock.php \Drupal\social_landing_page\Plugin\Block\ActivityOverviewBlock::getUsersCount()
  12. 10.2.x modules/social_features/social_landing_page/src/Plugin/Block/ActivityOverviewBlock.php \Drupal\social_landing_page\Plugin\Block\ActivityOverviewBlock::getUsersCount()

Get total count of users.

1 call to ActivityOverviewBlock::getUsersCount()
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 314

Class

ActivityOverviewBlock
Provides a 'ActivityOverviewBlock' block.

Namespace

Drupal\social_landing_page\Plugin\Block

Code

protected function getUsersCount() {

  // Skip blocked users and user 1.
  $query = $this->connection
    ->select('users_field_data', 'u');
  $query
    ->addExpression('COUNT(*)');
  $query
    ->condition('u.status', 1);
  $query
    ->condition('u.uid', 1, '<>');
  return $query
    ->execute()
    ->fetchField();
}