/**
  * Reset all stats about a group and delete all releases and binaries associated with that group.
  */
 public function purge($id)
 {
     require_once WWW_DIR . "/lib/binaries.php";
     $db = new DB();
     $releases = new Releases();
     $binaries = new Binaries();
     $this->reset($id);
     $rels = $db->query(sprintf("select ID from releases where groupID = %d", $id));
     foreach ($rels as $rel) {
         $releases->delete($rel["ID"]);
     }
     $bins = $db->query(sprintf("select ID from binaries where groupID = %d", $id));
     foreach ($bins as $bin) {
         $binaries->delete($bin["ID"]);
     }
 }