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