1 | <?php |
||
24 | class DataTypesModule extends ResourceLoaderModule { |
||
25 | |||
26 | /** |
||
27 | * @var DataType[] |
||
28 | */ |
||
29 | protected $dataTypes; |
||
30 | |||
31 | /** |
||
32 | * @var string |
||
33 | */ |
||
34 | protected $dataTypesConfigVarName; |
||
35 | |||
36 | /** |
||
37 | * @var DataTypeFactory |
||
38 | */ |
||
39 | protected $dataTypeFactory; |
||
40 | |||
41 | /** |
||
42 | * @since 0.1 |
||
43 | * |
||
44 | * @param array $resourceDefinition |
||
45 | */ |
||
46 | public function __construct( array $resourceDefinition ) { |
||
56 | |||
57 | /** |
||
58 | * @since 0.1 |
||
59 | * |
||
60 | * @param array $resourceDefinition |
||
61 | * |
||
62 | * @return string |
||
63 | * @throws Exception If the given resource definition is not sufficient |
||
64 | */ |
||
65 | public static function extractDataTypesConfigVarNameFromResourceDefinition( |
||
82 | |||
83 | /** |
||
84 | * @since 0.1 |
||
85 | * |
||
86 | * @param array $resourceDefinition |
||
87 | * |
||
88 | * @return DataTypeFactory |
||
89 | * @throws Exception If the given resource definition is not sufficient |
||
90 | */ |
||
91 | public static function extractDataTypeFactoryFromResourceDefinition( |
||
111 | |||
112 | /** |
||
113 | * Returns the name of the config var key under which the data type definition will be available |
||
114 | * in JavaScript using "mw.config.get( '...' )" |
||
115 | * |
||
116 | * @since 0.1 |
||
117 | * |
||
118 | * @return string |
||
119 | */ |
||
120 | public function getConfigVarName() { |
||
123 | |||
124 | /** |
||
125 | * Returns the data types factory providing the data type information. |
||
126 | * |
||
127 | * @since 0.1 |
||
128 | * |
||
129 | * @return DataTypeFactory |
||
130 | */ |
||
131 | public function getDataTypeFactory() { |
||
134 | |||
135 | /** |
||
136 | * Used to propagate available data type ids to JavaScript. |
||
137 | * Data type ids will be available in 'wbDataTypeIds' config var. |
||
138 | * @see ResourceLoaderModule::getScript |
||
139 | * |
||
140 | * @since 0.1 |
||
141 | * |
||
142 | * @param ResourceLoaderContext $context |
||
143 | * |
||
144 | * @return string |
||
145 | */ |
||
146 | public function getScript( ResourceLoaderContext $context ) { |
||
157 | |||
158 | /** |
||
159 | * Returns the message keys of the registered data types. |
||
160 | * @see ResourceLoaderModule::getMessages |
||
161 | * @since 0.1 |
||
162 | * |
||
163 | * @return Array |
||
164 | */ |
||
165 | public function getMessages() { |
||
177 | |||
178 | /** |
||
179 | * @see ResourceLoaderModule::getDefinitionSummary |
||
180 | * |
||
181 | * @param ResourceLoaderContext $context |
||
182 | * |
||
183 | * @return array |
||
184 | */ |
||
185 | public function getDefinitionSummary( ResourceLoaderContext $context ) { |
||
194 | |||
195 | } |
||
196 |