4 * @defgroup controlled_vocab
8 * @file ControlledVocab.inc.php
10 * Copyright (c) 2000-2009 John Willinsky
11 * Distributed under the GNU GPL v2. For full terms see the file docs/COPYING.
13 * @class ControlledVocab
14 * @ingroup controlled_vocab
15 * @see ControlledVocabDAO
17 * @brief Basic class describing an controlled vocab.
20 //$Id: ControlledVocab.inc.php,v 1.3 2009/05/13 00:13:20 asmecher Exp $
22 class ControlledVocab
extends DataObject
{
31 function getAssocId() {
32 return $this->getData('assocId');
39 function setAssocId($assocId) {
40 return $this->setData('assocId', $assocId);
44 * Get associated type.
47 function getAssocType() {
48 return $this->getData('assocType');
52 * Set associated type.
53 * @param $assocType int
55 function setAssocType($assocType) {
56 return $this->setData('assocType', $assocType);
63 function getSymbolic() {
64 return $this->getData('symbolic');
69 * @param $symbolic string
71 function setSymbolic($symbolic) {
72 return $this->setData('symbolic', $symbolic);
76 * Get a list of controlled vocabulary options.
77 * @param $settingName string optional
78 * @return array $controlledVocabEntryId => name
80 function enumerate($settingName = 'name') {
81 $controlledVocabDao =& DAORegistry
::getDAO('ControlledVocabDAO');
82 return $controlledVocabDao->enumerate($this->getId(), $settingName);