1 | <?php |
||
17 | class TermStore implements LabelLookup, EntityIdLookup { |
||
18 | |||
19 | private $storeWriter; |
||
20 | private $idLookup; |
||
21 | |||
22 | private $labelTable; |
||
23 | private $aliasesTable; |
||
24 | |||
25 | 17 | public function __construct( Connection $connection, TermStoreConfig $config ) { |
|
32 | |||
33 | /** |
||
34 | * @param EntityId $id |
||
35 | * @param Fingerprint $fingerprint |
||
36 | * |
||
37 | * @throws TermStoreException |
||
38 | */ |
||
39 | 15 | public function storeEntityFingerprint( EntityId $id, Fingerprint $fingerprint ) { |
|
42 | |||
43 | /** |
||
44 | * @param EntityId $id |
||
45 | * |
||
46 | * @throws TermStoreException |
||
47 | */ |
||
48 | public function dropTermsForId( EntityId $id ) { |
||
51 | |||
52 | /** |
||
53 | * @throws TermStoreException |
||
54 | */ |
||
55 | 3 | public function getLabelByIdAndLanguage( EntityId $id, string $languageCode ): ?string { |
|
69 | |||
70 | /** |
||
71 | * @param EntityId $id |
||
72 | * @param string $languageCode |
||
73 | * |
||
74 | * @return string[] |
||
75 | * @throws TermStoreException |
||
76 | */ |
||
77 | 3 | public function getAliasesByIdAndLanguage( EntityId $id, string $languageCode ): array { |
|
91 | |||
92 | /** |
||
93 | * Returns the first matching entity id. Case insensitive. |
||
94 | * |
||
95 | * @throws TermStoreException |
||
96 | */ |
||
97 | 2 | public function getIdByLabel( string $labelLanguageCode, string $labelText ): ?string { |
|
100 | |||
101 | /** |
||
102 | * Returns the first matching item id. Case insensitive. |
||
103 | * |
||
104 | * @throws TermStoreException |
||
105 | */ |
||
106 | 2 | public function getItemIdByLabel( string $labelLanguageCode, string $labelText ): ?string { |
|
109 | |||
110 | /** |
||
111 | * Returns the first matching property id. Case insensitive. |
||
112 | * |
||
113 | * @throws TermStoreException |
||
114 | */ |
||
115 | 2 | public function getPropertyIdByLabel( string $labelLanguageCode, string $labelText ): ?string { |
|
118 | |||
119 | /** |
||
120 | * Returns the first matching entity id. Case insensitive. |
||
121 | * |
||
122 | * @throws TermStoreException |
||
123 | */ |
||
124 | 2 | public function getIdByText( string $languageCode, string $termText ): ?string { |
|
127 | |||
128 | /** |
||
129 | * Returns the first matching item id. Case insensitive. |
||
130 | * |
||
131 | * @throws TermStoreException |
||
132 | */ |
||
133 | 2 | public function getItemIdByText( string $languageCode, string $termText ): ?string { |
|
136 | |||
137 | /** |
||
138 | * Returns the first matching property id. Case insensitive. |
||
139 | * |
||
140 | * @throws TermStoreException |
||
141 | */ |
||
142 | 2 | public function getPropertyIdByText( string $languageCode, string $termText ): ?string { |
|
145 | |||
146 | } |
||
147 |