Search:

# CWIS Developers Documentation

- Main Page
- Classes
- Files

- File List
- File Members

# ControlledNameFactory.php

Go to the documentation of this file.

    00001 <?PHP
    00002
    00003 #
    00004 #   FILE:  ControlledNameFactory.php
    00005 #
    00006 #   Part of the Collection Workflow Integration System
    00007 #   Copyright 2011 Edward Almasy and Internet Scout
    00008 #   http://scout.wisc.edu
    00009 #
    00010
    00014 class ControlledNameFactory extends ItemFactory {
    00015
    00016     # ---- PUBLIC INTERFACE --------------------------------------------------
    00017
    00018     function ControlledNameFactory($FieldId = NULL)
    00019     {
    00020         # set up item factory base class
    00021         $this->ItemFactory("ControlledName", "ControlledNames", "ControlledNameId", "ControlledName", $FieldId);
    00022     }
    00023
    00029     function GetUsageCount()
    00030     {
    00031         return $this->DB->Query("SELECT COUNT(DISTINCT RNI.ResourceId) AS ResourceCount"
    00032                 ." FROM ResourceNameInts RNI, ControlledNames CN"
    00033                 ." WHERE CN.FieldId = ".intval($this->FieldId)
    00034                 ." AND RNI.ControlledNameId = CN.ControlledNameId"
    00035                 ." AND RNI.ResourceId >= 0",
    00036                 "ResourceCount");
    00037     }
    00038
    00039
    00040     # ---- PRIVATE INTERFACE -------------------------------------------------
    00041
    00042 }
    00043
    00044
    00045 ?>