5 # Part of the Collection Workflow Integration System (CWIS)
6 # Copyright 2012 Internet Scout Project
7 # http://scout.wisc.edu/
13 # ---- PUBLIC INTERFACE --------------------------------------------------
35 # assume the qualifier operations will be successful
36 $this->
Status = self::STATUS_OK;
39 if (func_num_args() == 0)
41 # determine next qualifier ID
42 $HighestId = $this->DB->Query(
"
43 SELECT QualifierId FROM Qualifiers
44 ORDER BY QualifierId DESC
47 $this->
Id = $HighestId > 0 ? $HighestId + 1 : 1;
49 # add record to database with that ID
51 INSERT INTO Qualifiers
52 SET QualifierId = ".addslashes($this->
Id));
56 else if (!is_null($QualifierId))
58 $this->
Id = intval($QualifierId);
60 # attempt to load qualifier info from database
62 SELECT * FROM Qualifiers
63 WHERE QualifierId = '".addslashes($this->
Id).
"'");
65 # if the qualifier was found
66 if ($this->DB->NumRowsSelected() > 0)
68 # set attributes to values returned by database
69 $this->DBFields = $this->DB->FetchRow();
72 # the qualifier was not found
75 $this->
Status = self::STATUS_DOES_NOT_EXIST;
95 # do not try deleting a qualifier with a bad status
96 if ($this->
Status != self::STATUS_OK)
101 # delete record from database
103 DELETE FROM Qualifiers
104 WHERE QualifierId = ".addslashes($this->
Id));
107 $this->
Status = self::STATUS_DOES_NOT_EXIST;
126 return $this->
UpdateValue(
"QualifierName", $NewValue);
136 return $this->
UpdateValue(
"QualifierNamespace", $NewValue);
146 return $this->
UpdateValue(
"QualifierUrl", $NewValue);
149 # ---- PRIVATE INTERFACE -------------------------------------------------
179 return $this->DB->UpdateValue(
183 "QualifierId = '".addslashes($this->
Id).
"'",