CWIS Developer Documentation

- Home
- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Static Public Member Functions | List of all members
ControlledName Class Reference

Metadata type representing non-hierarchical controlled vocabulary values. More...

Inheritance diagram for ControlledName:
[legend]
Collaboration diagram for ControlledName:
[legend]

## Public Member Functions
| Name ($NewValue=DB_NOVALUE)
| Get or set the controlled vocabulary term. More...
| VariantName ($NewValue=DB_NOVALUE)
| Get, set, or clear any variant terms for this controlled name . More...
| FieldId ($NewValue=DB_NOVALUE)
| Get or set the MetadataField associated with this term. More...
| QualifierId ($NewValue=DB_NOVALUE)
| Get or set the Qualifier associated with this term via ID. More...
| Qualifier ($NewValue=DB_NOVALUE)
| Get or set the Qualifier associated with this term via object. More...
| InUse ()
| See if ControlledName is currently associated with any Resources. More...
| GetAssociatedResources ()
| Get resourceIds associated with this ControlledName. More...
| RemapTo ($NewNameId)
| Change all currently associated Resources to be instead associated with another ControlledName. More...
| UpdateLastAssigned ()
| Update the LastAssigned timestamp for this classification. More...
| Delete ($DeleteIfHasResources=FALSE)
| Remove ControlledName (and any accompanying associations from database. More...
Public Member Functions inherited from Item
| __construct ($Id)
| Constructor, used to load existing items. More...
| Destroy ()
| Destroy item. More...
| Delete ()
| Destroy item. More...
| Id ()
| Get item ID. More...
| Name ($NewValue=DB_NOVALUE)
| Get/set name of item. More...
| DateCreated ($NewValue=DB_NOVALUE)
| Get/set when item was created. More...
| CreatedBy ($NewValue=DB_NOVALUE)
| Get/set ID of user who created the item. More...
| DateLastModified ($NewValue=DB_NOVALUE)
| Get/set when item was last modified. More...
| LastModifiedBy ($NewValue=DB_NOVALUE)
| Get/set ID of user who last modified the item. More...

## Static Public Member Functions
static | Create ($Term, $FieldId)
| Create a new empty ControlledName if it's not already present. More...
static | ControlledNameExists ($Term, $FieldId)
| Check if there exists a controlledname with a ControlledName and FieldId same as given. More...
static | SearchForControlledName ($ControlledName, $FieldId)
| Check if the given controlled name already exists for a given field ID. More...
Static Public Member Functions inherited from Item
static | GetCanonicalId ($Id)
| Normalize item ID to canonical form. More...
static | ItemExists ($Id)
| Check whether an item exists with the specified ID. More...

## Additional Inherited Members
Public Attributes inherited from Item
const | NO_ITEM = -2123456789
| ID value used to indicate no item. More...
Protected Member Functions inherited from Item
| UpdateValue ($ColumnName, $NewValue=DB_NOVALUE)
| Convenience function to supply parameters to Database::UpdateValue(). More...
| UpdateDateValue ($ColumnName, $NewValue=DB_NOVALUE)
| Convenience function to supply parameters to Database::UpdateValue(), with preprocessing of new values to convert them into an SQL-compatible date format. More...
Static Protected Member Functions inherited from Item
static | CreateWithValues ($Values)
| Create a new item, using specified initial database values. More...
static | SetDatabaseAccessValues ($ClassName)
| Set the database access values (table name, ID column name, name column name) for specified class. More...
Protected Attributes inherited from Item
| $DB
| $Id
| $ItemIdColumnName
| $ItemNameColumnName
| $ItemTableName
| $ValueCache = array()
Static Protected Attributes inherited from Item
static | $ItemIdColumnNames
static | $ItemNameColumnNames
static | $ItemTableNames

## Detailed Description

Metadata type representing non-hierarchical controlled vocabulary values.

Hierarchical controlled vocabularies should use Classification.

Definition at line 14 of file ControlledName.php.

## Member Function Documentation

static ControlledName::ControlledNameExists | ( |  | $Term,
|  |  | $FieldId
| ) |  |
| static

Check if there exists a controlledname with a ControlledName and FieldId same as given.

This method is different from ItemExists(), which does check base on Id.

Parameters

  string | $Term | ControlledName of the controlledname.
  string | $FieldId | ID of the MetadataField.

Returns
  bool True if there exists such controlledname, false otherwise.

Definition at line 64 of file ControlledName.php.

References Item\$DB.

Referenced by ControlledName_Test\testControlledName().

Here is the caller graph for this function:

static ControlledName::Create | ( |  | $Term,
|  |  | $FieldId
| ) |  |
| static

Create a new empty ControlledName if it's not already present.

Caller should set other parameters after it's created. If a controlledname with given name and field ID already exists, this will just return that controlledname.

Parameters

  string | $Term | New controlled vocabulary term.
  int | $FieldId | ID of MetadataField for new term.

Returns
  A new ControlledName just created or the one in the database, if the controlledname already exists.

Definition at line 29 of file ControlledName.php.

References Item\$DB.

Referenced by MetadataField\Drop(), ResourceFactory\ImportResourcesFromXmlFile(), ControlledName_Test\testControlledName(), and Resource_Test\testGetSetClear().

Here is the caller graph for this function:

ControlledName::Delete | ( |  | $DeleteIfHasResources = `FALSE` | ) |

Remove ControlledName (and any accompanying associations from database.

This must be the last use of this object.

Parameters

  bool | $DeleteIfHasResources | Remove ControlledName even if Resources are currently associated with it. (OPTIONAL, defaults to FALSE)

Definition at line 305 of file ControlledName.php.

References Item\$DB, Item\Destroy(), Item\Id(), and InUse().

ControlledName::FieldId | ( |  | $NewValue = `DB_NOVALUE` | ) |

Get or set the MetadataField associated with this term.

Parameters

  int | $NewValue | ID of new MetadataField. (OPTIONAL)

Returns
  ID of associated MetadataField.

Definition at line 143 of file ControlledName.php.

References Item\UpdateValue().

ControlledName::GetAssociatedResources | ( |  | ) |

Get resourceIds associated with this ControlledName.

Returns
  array of ResourceIds.

Definition at line 239 of file ControlledName.php.

References Item\Id().

ControlledName::InUse | ( |  | ) |

See if ControlledName is currently associated with any Resources.

Returns
  TRUE if associated with at least one Resource, otherwise FALSE.

Definition at line 229 of file ControlledName.php.

References Item\Id().

Referenced by Delete().

Here is the caller graph for this function:

ControlledName::Name | ( |  | $NewValue = `DB_NOVALUE` | ) |

Get or set the controlled vocabulary term.

Parameters

  string | $NewValue | New value for term. (OPTIONAL)

Returns
  Controlled vocabulary term.

Definition at line 80 of file ControlledName.php.

References Item\UpdateValue().

ControlledName::Qualifier | ( |  | $NewValue = `DB_NOVALUE` | ) |

Get or set the Qualifier associated with this term via object.

Parameters

  Qualifier | $NewValue | New Qualifier. (OPTIONAL)

Returns
  Currently associated Qualifier.

Definition at line 163 of file ControlledName.php.

References DB_NOVALUE, Item\ItemExists(), and QualifierId().

ControlledName::QualifierId | ( |  | $NewValue = `DB_NOVALUE` | ) |

Get or set the Qualifier associated with this term via ID.

Parameters

  int | $NewValue | ID of new Qualifier. (OPTIONAL)

Returns
  ID of currently associated Qualifier.

Definition at line 153 of file ControlledName.php.

References Item\UpdateValue().

Referenced by Qualifier().

Here is the caller graph for this function:

ControlledName::RemapTo | ( |  | $NewNameId | ) |

Change all currently associated Resources to be instead associated with another ControlledName.

Parameters

  int | $NewNameId | ID of ControlledName to remap resources to.

Definition at line 253 of file ControlledName.php.

References Item\Id().

static ControlledName::SearchForControlledName | ( |  | $ControlledName,
|  |  | $FieldId
| ) |  |
| static

Check if the given controlled name already exists for a given field ID.

Parameters

  string | $ControlledName | Name to search for.
  int | $FieldId | ID of field to search.

Returns
  array Matching controlled name IDs, if any.

Definition at line 211 of file ControlledName.php.

Referenced by ControlledName_Test\testControlledName().

Here is the caller graph for this function:

ControlledName::UpdateLastAssigned | ( |  | ) |

Update the LastAssigned timestamp for this classification.

Definition at line 293 of file ControlledName.php.

References Item\Id().

ControlledName::VariantName | ( |  | $NewValue = `DB_NOVALUE` | ) |

Get, set, or clear any variant terms for this controlled name .

Parameters

  string | or bool $NewValue New value for variant terms. (OPTIONAL) Pass no argument to just retrieve current variant name. Pass FALSE to unset any variant name attached.

Returns
  Return the current variant name. If this ControlledName is not attached to any variant name, NULL will be returned.

Definition at line 94 of file ControlledName.php.

References DB_NOVALUE, and Item\Id().

The documentation for this class was generated from the following file:

- objects/ControlledName.php