baseline
[omp.pkp.sfu.ca.git] / lib / pkp / classes / controlledVocab / ControlledVocab.inc.php
blob1376b8c53661f729ba1a2ac16f46511faff89c5e
1 <?php
3 /**
4 * @defgroup controlled_vocab
5 */
7 /**
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 {
24 // Get/set methods
27 /**
28 * get assoc id
29 * @return int
31 function getAssocId() {
32 return $this->getData('assocId');
35 /**
36 * set assoc id
37 * @param $assocId int
39 function setAssocId($assocId) {
40 return $this->setData('assocId', $assocId);
43 /**
44 * Get associated type.
45 * @return int
47 function getAssocType() {
48 return $this->getData('assocType');
51 /**
52 * Set associated type.
53 * @param $assocType int
55 function setAssocType($assocType) {
56 return $this->setData('assocType', $assocType);
59 /**
60 * Get symbolic name.
61 * @return string
63 function getSymbolic() {
64 return $this->getData('symbolic');
67 /**
68 * Set symbolic name.
69 * @param $symbolic string
71 function setSymbolic($symbolic) {
72 return $this->setData('symbolic', $symbolic);
75 /**
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);