1 | <?php |
||
13 | abstract class EntityStore { |
||
14 | |||
15 | /** |
||
16 | * Only stores/and returns labels, descriptions and aliases in these languages |
||
17 | */ |
||
18 | const OPTION_LANGUAGES = 'languages'; |
||
19 | |||
20 | /** |
||
21 | * Enables the language fallback system |
||
22 | */ |
||
23 | const OPTION_LANGUAGE_FALLBACK = 'languagefallback'; |
||
24 | |||
25 | /** |
||
26 | * @var EntityStoreOptions |
||
27 | */ |
||
28 | private $options; |
||
29 | |||
30 | /** |
||
31 | * @param EntityStoreOptions $options |
||
32 | */ |
||
33 | 11 | public function __construct( EntityStoreOptions $options = null ) { |
|
38 | |||
39 | 11 | private function setupOptions() { |
|
43 | |||
44 | /** |
||
45 | * @return EntityLookup |
||
46 | */ |
||
47 | 1 | public function getEntityLookup() { |
|
50 | |||
51 | /** |
||
52 | * @return EntityDocumentLookup |
||
53 | */ |
||
54 | 1 | public function getEntityDocumentLookup() { |
|
57 | |||
58 | /** |
||
59 | * @return ItemLookup |
||
60 | */ |
||
61 | 1 | public function getItemLookup() { |
|
64 | |||
65 | /** |
||
66 | * @return PropertyLookup |
||
67 | */ |
||
68 | 1 | public function getPropertyLookup() { |
|
71 | |||
72 | /** |
||
73 | * @return ItemIdForTermLookup |
||
74 | */ |
||
75 | 1 | public function getItemIdForTermLookup() { |
|
78 | |||
79 | /** |
||
80 | * @return PropertyIdForTermLookup |
||
81 | */ |
||
82 | 1 | public function getPropertyIdForTermLookup() { |
|
85 | |||
86 | /** |
||
87 | * @return ItemIdForQueryLookup |
||
88 | */ |
||
89 | 1 | public function getItemIdForQueryLookup() { |
|
92 | |||
93 | /** |
||
94 | * @return PropertyIdForQueryLookup |
||
95 | */ |
||
96 | 1 | public function getPropertyIdForQueryLookup() { |
|
99 | |||
100 | /** |
||
101 | * @return EntityDocumentSaver |
||
102 | */ |
||
103 | 1 | public function getEntityDocumentSaver() { |
|
106 | |||
107 | /** |
||
108 | * Setup the EntityStore if it has not been done yet (create database tables...). |
||
109 | * |
||
110 | * It should not drop data if the store is already setup. |
||
111 | */ |
||
112 | public function setupStore() { |
||
114 | |||
115 | /** |
||
116 | * Setup the indexes if it has not been done yet. |
||
117 | * |
||
118 | * Often called after big importations to create again indexes. |
||
119 | */ |
||
120 | public function setupIndexes() { |
||
122 | |||
123 | /** |
||
124 | * @return EntityStoreOptions |
||
125 | */ |
||
126 | 2 | protected function getOptions() { |
|
129 | |||
130 | /** |
||
131 | * @see EntityStoreOptions::getOption |
||
132 | */ |
||
133 | 1 | protected function getOption( $option ) { |
|
136 | |||
137 | /** |
||
138 | * @see EntityStoreOptions::defaultOption |
||
139 | */ |
||
140 | 11 | protected function defaultOption( $option, $default ) { |
|
143 | } |
||
144 |