CWIS Developer Documentation

- Home
- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

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 Name($NewValue=DB_NOVALUE)
46 {
47 return $this->UpdateValue("QualifierName", $NewValue);
48 }
49
55 public function NSpace($NewValue=DB_NOVALUE)
56 {
57 return $this->UpdateValue("QualifierNamespace", $NewValue);
58 }
59
65 public function Url($NewValue=DB_NOVALUE)
66 {
67 return $this->UpdateValue("QualifierUrl", $NewValue);
68 }
69 }
Item\UpdateValue
UpdateValue($ColumnName, $NewValue=DB_NOVALUE)
Convenience function to supply parameters to Database::UpdateValue().
Definition: Item.php:284
Database
SQL database abstraction object with smart query caching.
Definition: Database.php:22
Qualifier\Url
Url($NewValue=DB_NOVALUE)
Get or set the qualifier URL.
Definition: Qualifier.php:65
Item\$DB
$DB
Definition: Item.php:210
Qualifier
Definition: Qualifier.php:10
PHP
PHP
Definition: RSSClient--Test.php:12
Item
Common base class for persistent items store in database.
Definition: Item.php:13
DB_NOVALUE
const DB_NOVALUE
Definition: Database.php:1738
Qualifier\Create
static Create()
Initialize a new qualifier.
Definition: Qualifier.php:19
Qualifier\Name
Name($NewValue=DB_NOVALUE)
Get or set the qualifier name.
Definition: Qualifier.php:45
Item\$Id
$Id
Definition: Item.php:211
Qualifier\NSpace
NSpace($NewValue=DB_NOVALUE)
Get or set the qualifier namespace.
Definition: Qualifier.php:55