Search:

# CWIS Developers Documentation

Public Member Functions | Static Public Member Functions

# ControlledName Class Reference

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

## Public Member Functions
| ControlledName ($NameId, $Name=NULL, $FieldId=NULL, $QualifierId="NULL", $VariantName=NULL)
| Class constructor.
| Status ()
| Check success of constructor.
| Id ()
| Get ID.
| Name ($NewValue=DB_NOVALUE)
| Get or set the controlled vocabulary term.
| VariantName ($NewValue=DB_NOVALUE)
| Get or set any variant terms for this controlled name .
| FieldId ($NewValue=DB_NOVALUE)
| Get or set the MetadataField associated with this term.
| QualifierId ($NewValue=DB_NOVALUE)
| Get or set the Qualifier associated with this term via ID.
| Variant ($NewValue=DB_NOVALUE)
| Get or set ???
| Qualifier ($NewValue=DB_NOVALUE)
| Get or set the Qualifier associated with this term via object.
| InUse ()
| See if ControlledName is currently associated with any Resources.
| RemapTo ($NewNameId)
| Change all currently associated Resources to be instead associated with another ControlledName.
| Delete ($DeleteIfHasResources=FALSE)
| Remove ControlledName (and any accompanying associations from database.
## Static Public Member Functions
static | SearchForControlledName ($ControlledName, $FieldId)
| Check if a controlled name already exists for a given field.
## Public Attributes
Status Codes (set by constructor and retrieved via Status())
const | STATUS_OK = 0
| Successful execution.
const | STATUS_INVALID_ID = 1
| No ControlledName exists with specified ID.
const | STATUS_EXISTS = 2
| ControlledName already exists with this term.

List of all members.

## Detailed Description

Metadata type representing non-hierarchical controlled vocabulary values.

Hierarchical controlled vocabularies should use Classification.

Definition at line 15 of file ControlledName.php.

## Member Function Documentation

ControlledName::ControlledName | ( | $ | 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:

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

Definition at line 40 of file ControlledName.php.

References Id(), STATUS_EXISTS, STATUS_INVALID_ID, and STATUS_OK.

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

Remove ControlledName (and any accompanying associations from database.

This must be the last use of this object.

Parameters:

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

Definition at line 269 of file ControlledName.php.

References Id(), and InUse().

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

Get or set the MetadataField associated with this term.

Parameters:

  NewValue | ID of new MetadataField. (OPTIONAL)

Returns:
  ID of associated MetadataField.

Definition at line 157 of file ControlledName.php.

ControlledName::Id | ( | ) |

Get ID.

Returns:
  ControlledName ID.

Definition at line 134 of file ControlledName.php.

References Id().

Referenced by ControlledName(), Delete(), Id(), InUse(), and RemapTo().

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 246 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:

  NewValue | New value for term. (OPTIONAL)

Returns:
  Controlled vocabulary term.

Definition at line 141 of file ControlledName.php.

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

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

Parameters:

  NewValue | New Qualifier. (OPTIONAL)

Returns:
  Currently associated Qualifier.

Definition at line 181 of file ControlledName.php.

References QualifierId().

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

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

Parameters:

  NewValue | ID of new Qualifier. (OPTIONAL)

Returns:
  ID of currently associated Qualifier.

Definition at line 165 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:

  NewNameId | ID of ControlledName to remap resources to.

Definition at line 257 of file ControlledName.php.

References Id().

static ControlledName::SearchForControlledName | ( | $ | ControlledName,
|  | $ | FieldId
| ) |  | `[static]`

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

Returns:
  array of matching ControlledNameIds if found, empty array otherwise.
  TRUE if the name exists, FALSE otherwise.

Definition at line 227 of file ControlledName.php.

ControlledName::Status | ( | ) |

Check success of constructor.

Returns:
  Status code for constructor.

Definition at line 128 of file ControlledName.php.

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

Get or set ???

Parameters:

  NewValue | New value for ???. (OPTIONAL)

Returns:
  ???.

Definition at line 173 of file ControlledName.php.

References VariantName().

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

Get or set any variant terms for this controlled name .

Parameters:

  NewValue | New value for variant terms. (OPTIONAL)

Returns:
  Variant term.

Definition at line 149 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().

const ControlledName::STATUS_INVALID_ID = 1

No ControlledName exists with specified ID.

Definition at line 23 of file ControlledName.php.

Referenced by ControlledName().

const ControlledName::STATUS_OK = 0

Successful execution.

Definition at line 21 of file ControlledName.php.

Referenced by ControlledName().

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

- ControlledName.php