protected function getGroupsCount() {
    // There is no unpublished option for groups.
    $query = $this->connection->select('groups', 'g');
    $query->addExpression('COUNT(*)');
    return $query->execute()->fetchField();
  }