/**
  * update a single select field's attr/value. Note that if the value already exists,
  * it will OR the bits. This is used when you want more than one type of operation
  * for a select field, such as select_max and sort.
  */
 public function update($name, $attr)
 {
     require_once "RodsGenQueryNum.inc.php";
     //load magic numbers
     if (!isset($GLOBALS['PRODS_GENQUE_NUMS']["{$name}"])) {
         throw new RODSException("General Query select field name '{$name}' is not valid", 'PERR_USER_INPUT_ERROR');
     }
     $newattr = RODSGenQueSelFlds::attr2GenQueNumber($attr);
     for ($i = 0; $i < count($this->names); $i++) {
         if ($this->names[$i] == $name) {
             if ($this->attrs[$i] == 1) {
                 $this->attrs[$i] = $newattr;
             } else {
                 $this->attrs[$i] = $newattr | $this->attrs[$i];
             }
             return;
         }
     }
     $this->add($name, $attr);
 }