public function setMode($mode){ $oldMode = $this->mode; switch($mode){ case RS_MODE_ID: $this->mode = RS_MODE_ID; break; case RS_MODE_SEED: $this->mode = RS_MODE_SEED; break; default: // TODO: Error out, set mode to ID; $this->mode = RS_MODE_ERROR; break; } return $oldMode; } public function setId($id){ // Id must be an integer greater than 0 if (is_int($id) && $id > 0){ $this->id = $id; return true; }else{ // TODO: Error out, not valid id; return false; } } public function setSeed($seed){ // Seed must be an integer, it is usually a unix timestamp if (is_int($seed)){ $this->seed = $seed; return true; }else{ return false; } } public function setLength($length){ // Length must also be an integer. if (is_int($length)){ $this->length = $length; return true; }else{ return false; } } public function getMode(){ return $this->mode; } public function