1 | <?php |
||
13 | class IdLookup implements EntityIdLookup { |
||
14 | |||
15 | private $labelTable; |
||
16 | private $aliasesTable; |
||
17 | |||
18 | 16 | public function __construct( TableQueryExecutor $labelTable, TableQueryExecutor $aliasesTable ) { |
|
22 | |||
23 | /** |
||
24 | * Returns the first matching entity id. Case insensitive. |
||
25 | * |
||
26 | * @throws TermStoreException |
||
27 | */ |
||
28 | 2 | public function getIdByLabel( string $labelLanguageCode, string $labelText ): ?string { |
|
31 | |||
32 | /** |
||
33 | * Returns the first matching item id. Case insensitive. |
||
34 | * |
||
35 | * @throws TermStoreException |
||
36 | */ |
||
37 | 2 | public function getItemIdByLabel( string $labelLanguageCode, string $labelText ): ?string { |
|
40 | |||
41 | /** |
||
42 | * Returns the first matching property id. Case insensitive. |
||
43 | * |
||
44 | * @throws TermStoreException |
||
45 | */ |
||
46 | 2 | public function getPropertyIdByLabel( string $labelLanguageCode, string $labelText ): ?string { |
|
49 | |||
50 | /** |
||
51 | * @param string $labelLanguageCode |
||
52 | * @param string $labelText |
||
53 | * @param string|null $entityTypeFilter |
||
54 | * |
||
55 | * @return string|null |
||
56 | * @throws TermStoreException |
||
57 | */ |
||
58 | 12 | private function getEntityIdByLabel( $labelLanguageCode, $labelText, $entityTypeFilter = null ) { |
|
78 | |||
79 | /** |
||
80 | * Returns the first matching entity id. Case insensitive. |
||
81 | * |
||
82 | * @throws TermStoreException |
||
83 | */ |
||
84 | 2 | public function getIdByText( string $languageCode, string $termText ): ?string { |
|
87 | |||
88 | /** |
||
89 | * Returns the first matching item id. Case insensitive. |
||
90 | * |
||
91 | * @throws TermStoreException |
||
92 | */ |
||
93 | 2 | public function getItemIdByText( string $languageCode, string $termText ): ?string { |
|
96 | |||
97 | /** |
||
98 | * Returns the first matching property id. Case insensitive. |
||
99 | * |
||
100 | * @throws TermStoreException |
||
101 | */ |
||
102 | 2 | public function getPropertyIdByText( string $languageCode, string $termText ): ?string { |
|
105 | |||
106 | /** |
||
107 | * @param string $languageCode |
||
108 | * @param string $termText |
||
109 | * @param string|null $entityTypeFilter |
||
110 | * |
||
111 | * @return string|null |
||
112 | * @throws TermStoreException |
||
113 | */ |
||
114 | 6 | private function getEntityIdByText( string $languageCode, string $termText, $entityTypeFilter = null ) { |
|
123 | |||
124 | /** |
||
125 | * @param string $aliasLanguageCode |
||
126 | * @param string $aliasText |
||
127 | * @param string|null $entityTypeFilter |
||
128 | * |
||
129 | * @return string|null |
||
130 | * @throws TermStoreException |
||
131 | */ |
||
132 | 3 | private function getIdByAlias( string $aliasLanguageCode, string $aliasText, $entityTypeFilter = null ) { |
|
152 | |||
153 | } |