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...

## Public Member Functions
| __construct ($NameId, $Name=NULL, $FieldId=NULL, $QualifierId="NULL", $VariantName=NULL)
| Class constructor. More...
| Status ()
| Check success of constructor. More...
| Id ()
| Get ID. More...
| Name ($NewValue=DB_NOVALUE)
| Get or set the controlled vocabulary term. More...
| VariantName ($NewValue=DB_NOVALUE)
| Get or set 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...
| Variant ($NewValue=DB_NOVALUE)
| Get or set the controlled name variant. 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...

## Static Public Member Functions
static | SearchForControlledName ($ControlledName, $FieldId)
| Check if the given controlled name already exists for a given field ID. More...

## Public Attributes
Status Codes (set by constructor and retrieved via Status())
const | STATUS_OK = 0
| Successful execution. More...
const | STATUS_INVALID_ID = 1
| No ControlledName exists with specified ID. More...
const | STATUS_EXISTS = 2
| ControlledName already exists with this term. More...

## Detailed Description

Metadata type representing non-hierarchical controlled vocabulary values.

Hierarchical controlled vocabularies should use Classification.

Definition at line 14 of file ControlledName.php.

## Constructor & Destructor Documentation

ControlledName::__construct | ( |  | $NameId,
|  |  | $Name = `NULL`,
|  |  | $FieldId = `NULL`,
|  |  | $QualifierId = `"NULL"`,
|  |  | $VariantName = `NULL`
| ) |  |

Class constructor.

This can be used both to access an existing controlled vocabulary term or to add a new term. For existing terms pass in just the ControlledName ID. To create a new term pass in NULL for the ID, and specify the term, the metadata field ID, and the qualifier ID (if any) and variant name (if any).

Parameters

  int | $NameId | ControlledName ID (NULL if creating new).
  string | $Name | New controlled vocabulary term. (OPTIONAL)
  int | $FieldId | ID of MetadataField for new term. (OPTIONAL)
  int | $QualifierId | ID of Qualifier for new term (if any). (OPTIONAL)
  string | $VariantName | Variant names for new term (if any). (OPTIONAL)

Definition at line 40 of file ControlledName.php.

References Id().

## Member Function Documentation

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 339 of file ControlledName.php.

References DB_NOVALUE, 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 168 of file ControlledName.php.

ControlledName::GetAssociatedResources | ( |  | ) |

Get resourceIds associated with this ControlledName.

Returns
  array of ResourceIds.

Definition at line 273 of file ControlledName.php.

References Id().

ControlledName::Id | ( |  | ) |

Get ID.

Returns
  ControlledName ID.

Definition at line 138 of file ControlledName.php.

Referenced by __construct(), Delete(), GetAssociatedResources(), InUse(), RemapTo(), and UpdateLastAssigned().

Here is the caller graph for this function:

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 263 of file ControlledName.php.

References 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 148 of file ControlledName.php.

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 198 of file ControlledName.php.

References DB_NOVALUE, 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 178 of file ControlledName.php.

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 287 of file ControlledName.php.

References 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 245 of file ControlledName.php.

Referenced by ControlledName_Test\testClassification().

Here is the caller graph for this function:

ControlledName::Status | ( |  | ) |

Check success of constructor.

Returns
  Status code for constructor.

Definition at line 129 of file ControlledName.php.

ControlledName::UpdateLastAssigned | ( |  | ) |

Update the LastAssigned timestamp for this classification.

Definition at line 327 of file ControlledName.php.

References Id().

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

Get or set the controlled name variant.

Parameters

  string | $NewValue | New value of the controlled name variant. (OPTIONAL)

Returns
  the current value of the controlled name variant.

Definition at line 188 of file ControlledName.php.

References VariantName().

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

Get or set any variant terms for this controlled name .

Parameters

  string | $NewValue | New value for variant terms. (OPTIONAL)

Returns
  Variant term.

Definition at line 158 of file ControlledName.php.

Referenced by Variant().

Here is the caller graph for this function:

## Member Data Documentation

const ControlledName::STATUS_EXISTS = 2

ControlledName already exists with this term.

Definition at line 25 of file ControlledName.php.

Referenced by ControlledName_Test\testClassification().

const ControlledName::STATUS_INVALID_ID = 1

No ControlledName exists with specified ID.

Definition at line 23 of file ControlledName.php.

Referenced by ControlledName_Test\testClassification().

const ControlledName::STATUS_OK = 0

Successful execution.

Definition at line 21 of file ControlledName.php.

Referenced by Resource\Set(), and ControlledName_Test\testClassification().

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

- objects/ControlledName.php