1 | <?php |
||
20 | class Term implements Comparable, FacetContainer { |
||
21 | |||
22 | /** |
||
23 | * @var string Language code identifying the language of the text, but note that there is |
||
24 | * nothing this class can do to enforce this convention. |
||
25 | */ |
||
26 | private $languageCode; |
||
27 | |||
28 | /** |
||
29 | * @var string |
||
30 | */ |
||
31 | private $text; |
||
32 | |||
33 | /** |
||
34 | * @var FacetManager |
||
35 | */ |
||
36 | private $facetManager; |
||
37 | |||
38 | /** |
||
39 | * @param string $languageCode Language of the text. |
||
40 | * @param string $text |
||
41 | * |
||
42 | * @throws InvalidArgumentException |
||
43 | */ |
||
44 | 13 | public function __construct( $languageCode, $text ) { |
|
56 | |||
57 | /** |
||
58 | * @return string |
||
59 | */ |
||
60 | 1 | public function getLanguageCode() { |
|
63 | |||
64 | /** |
||
65 | * @return string |
||
66 | */ |
||
67 | 1 | public function getText() { |
|
70 | |||
71 | /** |
||
72 | * @see Comparable::equals |
||
73 | * |
||
74 | * @param mixed $target |
||
75 | * |
||
76 | * @return bool |
||
77 | */ |
||
78 | 1 | public function equals( $target ) { |
|
88 | |||
89 | /** |
||
90 | * @param string $name |
||
91 | * |
||
92 | * @return boolean |
||
93 | */ |
||
94 | 1 | public function hasFacet( $name ) { |
|
97 | |||
98 | /** |
||
99 | * @return string[] |
||
100 | */ |
||
101 | 1 | public function listFacets() { |
|
104 | |||
105 | /** |
||
106 | * @param string $name |
||
107 | * @param string|null $type The desired type |
||
108 | * |
||
109 | * @return object |
||
110 | */ |
||
111 | 2 | public function getFacet( $name, $type = null ) { |
|
118 | |||
119 | /** |
||
120 | * @param string $name |
||
121 | * @param object $facetObject |
||
122 | */ |
||
123 | 4 | public function addFacet( $name, $facetObject ) { |
|
130 | |||
131 | } |
||
132 |