CWIS Developer Documentation
ControlledNameFactory.php
Go to the documentation of this file.
1 <?PHP
2 #
3 # FILE: ControlledNameFactory.php
4 #
5 # Part of the Collection Workflow Integration System (CWIS)
6 # Copyright 2011-2013 Edward Almasy and Internet Scout Research Group
7 # http://scout.wisc.edu/cwis/
8 #
9 
14 
15  # ---- PUBLIC INTERFACE --------------------------------------------------
16 
21  function __construct($FieldId = NULL)
22  {
23  # save field ID for our later use
24  $this->FieldId = $FieldId;
25 
26  # set up item factory base class
27  $this->ItemFactory("ControlledName", "ControlledNames",
28  "ControlledNameId", "ControlledName", FALSE,
29  ($FieldId ? "FieldId = ".intval($FieldId) : NULL));
30  }
31 
37  function GetUsageCount()
38  {
39  return $this->DB->Query(
40  "SELECT COUNT(DISTINCT RNI.ResourceId) AS ResourceCount"
41  ." FROM ResourceNameInts RNI, ControlledNames CN"
42  ." WHERE CN.FieldId = ".intval($this->FieldId)
43  ." AND RNI.ControlledNameId = CN.ControlledNameId"
44  ." AND RNI.ResourceId >= 0",
45  "ResourceCount");
46  }
47 
48 
49  # ---- PRIVATE INTERFACE -------------------------------------------------
50 
51  private $FieldId;
52 }
53 
__construct($FieldId=NULL)
Constructor for ControlledNameFactory class.
PHP
Definition: OAIClient.php:39
Factory for manipulating ControlledName objects.
GetUsageCount()
Determine how many resources have controlled names (associated with this metadata field) assigned to ...
Common factory class for item manipulation.
Definition: ItemFactory.php:17
ItemFactory($ItemClassName, $ItemTableName, $ItemIdFieldName, $ItemNameFieldName=NULL, $OrderOpsAllowed=FALSE, $SqlCondition=NULL)
Class constructor.
Definition: ItemFactory.php:36