-
Notifications
You must be signed in to change notification settings - Fork 1
/
ConceptList.inc.php
executable file
·74 lines (64 loc) · 1.27 KB
/
ConceptList.inc.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<?php
/**
* Contains a list of concept IDs and a ConceptListDefinition.
*/
class ConceptList
{
/**
* Object that implements the iConceptListDefinition interface
*/
public $cld = null;
/**
* Array of concept ids.
*/
private $arr_concept_id = null;
/**
* Constructor
*/
public function __construct($cld)
{
$this->cld = $cld;
$this->arr_concept_id = array();
}
/**
* Returns the ConceptListDefinition object.
*/
public function getDefinition() {
return $this->cld;
}
/**
* Add a concept_id to the list
*/
public function addConcept($concept_id)
{
$this->arr_concept_id[$concept_id] = $concept_id;
}
/**
* True if the passed concept_id is a member of this list.
*/
public function isMember($concept_id)
{
return isset($this->arr_concept_id[$concept_id]);
}
/**
* Returns the entire array of concept ids.
*/
public function getArray()
{
return $this->arr_concept_id;
}
/**
* Returns a comma-separated string of concept ids.
*/
public function getCsv()
{
return implode(',', $this->arr_concept_id);
}
/**
* Returns the number of concept_ids in the list.
*/
public function getCount()
{
return count($this->arr_concept_id);
}
}