1 | <?php |
||
20 | class GraphQLFieldRow extends RowPluginBase { |
||
21 | |||
22 | /** |
||
23 | * {@inheritdoc} |
||
24 | */ |
||
25 | protected $usesFields = TRUE; |
||
26 | |||
27 | /** |
||
28 | * Stores an array of prepared field aliases from options. |
||
29 | * |
||
30 | * @var array |
||
31 | */ |
||
32 | protected $replacementAliases = []; |
||
33 | |||
34 | /** |
||
35 | * Stores an array of options to determine if the raw field output is used. |
||
36 | * |
||
37 | * @var array |
||
38 | */ |
||
39 | protected $rawOutputOptions = []; |
||
40 | |||
41 | /** |
||
42 | * Stores an array of field GrpahQL type. |
||
43 | * |
||
44 | * @var array |
||
45 | */ |
||
46 | protected $typeOptions = []; |
||
47 | |||
48 | /** |
||
49 | * {@inheritdoc} |
||
50 | */ |
||
51 | public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL) { |
||
64 | |||
65 | /** |
||
66 | * {@inheritdoc} |
||
67 | */ |
||
68 | protected function defineOptions() { |
||
74 | |||
75 | /** |
||
76 | * {@inheritdoc} |
||
77 | */ |
||
78 | public function buildOptionsForm(&$form, FormStateInterface $form_state) { |
||
134 | |||
135 | /** |
||
136 | * Form element validation handler. |
||
137 | */ |
||
138 | public function validateAliasName($element, FormStateInterface $form_state) { |
||
143 | |||
144 | /** |
||
145 | * {@inheritdoc} |
||
146 | */ |
||
147 | public function validateOptionsForm(&$form, FormStateInterface $form_state) { |
||
157 | |||
158 | /** |
||
159 | * {@inheritdoc} |
||
160 | */ |
||
161 | public function render($row) { |
||
182 | |||
183 | /** |
||
184 | * Return an alias for a field ID, as set in the options form. |
||
185 | * |
||
186 | * @param string $id |
||
187 | * The field id to lookup an alias for. |
||
188 | * |
||
189 | * @return string |
||
190 | * The matches user entered alias, or the original ID if nothing is found. |
||
191 | */ |
||
192 | public function getFieldKeyAlias($id) { |
||
199 | |||
200 | /** |
||
201 | * Return a GraphQL field type, as set in the options form. |
||
202 | * |
||
203 | * @param string $id |
||
204 | * The field id to lookup a type for. |
||
205 | * |
||
206 | * @return string |
||
207 | * The matches user entered type, or String. |
||
208 | */ |
||
209 | public function getFieldType($id) { |
||
216 | |||
217 | /** |
||
218 | * Extracts a set of option values from a nested options array. |
||
219 | * |
||
220 | * @param string $key |
||
221 | * The key to extract from each array item. |
||
222 | * @param array $options |
||
223 | * The options array to return values from. |
||
224 | * |
||
225 | * @return array |
||
226 | * A regular one dimensional array of values. |
||
227 | */ |
||
228 | protected static function extractFromOptionsArray($key, array $options) { |
||
233 | |||
234 | } |
||
235 |