public function getCategories(array $nids) {

    $condition = TRUE; // Could feasibly want TRUE under different circumstances
    if($nids){
      $condition = "n.nid NOT IN (".implode(',', $nids).")";
    }

    $sql = "SELECT title 
            FROM {node_field_data} n
            WHERE n.type = 'activity'
            AND " . $condition . "
            AND n.status = '1'
            ORDER BY title ASC";

    $connection = \Drupal::database();
    $query = $connection->query($sql);
    $result = $query->fetchCol();
    natsort($result);
    return $result;
  }