CWIS Developer Documentation
Qualifier.php
Go to the documentation of this file.
1 <?PHP
2 #
3 # FILE: Qualifier.php
4 #
5 # Part of the Collection Workflow Integration System (CWIS)
6 # Copyright 2012-2013 Edward Almasy and Internet Scout Research Group
7 # http://scout.wisc.edu/cwis/
8 #
9 
10 class Qualifier extends Item
11 {
12 
13  # ---- PUBLIC INTERFACE --------------------------------------------------
14 
19  public static function Create()
20  {
21  $DB = new Database();
22 
23  # determine next qualifier ID
24  $HighestId = $DB->Query("
25  SELECT QualifierId FROM Qualifiers
26  ORDER BY QualifierId DESC
27  LIMIT 1", "QualifierId");
28  $Id = $HighestId > 0 ? $HighestId + 1 : 1;
29 
30  # add record to database with that ID
31  $DB->Query("
32  INSERT INTO Qualifiers
33  SET QualifierId = ".addslashes($Id));
34 
35  # use that ID to create new Qualifer object
36  $Qualifer = new Qualifier($Id);
37  return $Qualifer;
38  }
39 
45  public function NSpace($NewValue=DB_NOVALUE)
46  {
47  return $this->UpdateValue("QualifierNamespace", $NewValue);
48  }
49 
55  public function Url($NewValue=DB_NOVALUE)
56  {
57  return $this->UpdateValue("QualifierUrl", $NewValue);
58  }
59 }
UpdateValue($ColumnName, $NewValue=DB_NOVALUE)
Convenience function to supply parameters to Database::UpdateValue().
Definition: Item.php:285
SQL database abstraction object with smart query caching.
Definition: Database.php:22
Url($NewValue=DB_NOVALUE)
Get or set the qualifier URL.
Definition: Qualifier.php:55
$DB
Definition: Item.php:210
Common base class for persistent items store in database.
Definition: Item.php:13
const DB_NOVALUE
Definition: Database.php:1784
static Create()
Initialize a new qualifier.
Definition: Qualifier.php:19
$Id
Definition: Item.php:211
NSpace($NewValue=DB_NOVALUE)
Get or set the qualifier namespace.
Definition: Qualifier.php:45