Mercurial > hg > isophonics-drupal-site
comparison core/modules/views/src/EntityViewsData.php @ 14:1fec387a4317
Update Drupal core to 8.5.2 via Composer
author | Chris Cannam |
---|---|
date | Mon, 23 Apr 2018 09:46:53 +0100 |
parents | 4c8ae668cc8c |
children | c2387f117808 |
comparison
equal
deleted
inserted
replaced
13:5fb285c0d0e3 | 14:1fec387a4317 |
---|---|
175 | 175 |
176 // Entity types must implement a list_builder in order to use Views' | 176 // Entity types must implement a list_builder in order to use Views' |
177 // entity operations field. | 177 // entity operations field. |
178 if ($this->entityType->hasListBuilderClass()) { | 178 if ($this->entityType->hasListBuilderClass()) { |
179 $data[$base_table]['operations'] = [ | 179 $data[$base_table]['operations'] = [ |
180 'field' => [ | |
181 'title' => $this->t('Operations links'), | |
182 'help' => $this->t('Provides links to perform entity operations.'), | |
183 'id' => 'entity_operations', | |
184 ], | |
185 ]; | |
186 $data[$revision_table]['operations'] = [ | |
180 'field' => [ | 187 'field' => [ |
181 'title' => $this->t('Operations links'), | 188 'title' => $this->t('Operations links'), |
182 'help' => $this->t('Provides links to perform entity operations.'), | 189 'help' => $this->t('Provides links to perform entity operations.'), |
183 'id' => 'entity_operations', | 190 'id' => 'entity_operations', |
184 ], | 191 ], |
376 // Add all properties to views table data. We need an entry for each | 383 // Add all properties to views table data. We need an entry for each |
377 // column of each field, with the first one given special treatment. | 384 // column of each field, with the first one given special treatment. |
378 // @todo Introduce concept of the "main" column for a field, rather than | 385 // @todo Introduce concept of the "main" column for a field, rather than |
379 // assuming the first one is the main column. See also what the | 386 // assuming the first one is the main column. See also what the |
380 // mapSingleFieldViewsData() method does with $first. | 387 // mapSingleFieldViewsData() method does with $first. |
381 $multiple = (count($field_column_mapping) > 1); | |
382 $first = TRUE; | 388 $first = TRUE; |
383 foreach ($field_column_mapping as $field_column_name => $schema_field_name) { | 389 foreach ($field_column_mapping as $field_column_name => $schema_field_name) { |
384 $views_field_name = ($multiple) ? $field_name . '__' . $field_column_name : $field_name; | 390 $table_data[$schema_field_name] = $this->mapSingleFieldViewsData($table, $field_name, $field_definition_type, $field_column_name, $field_schema['columns'][$field_column_name]['type'], $first, $field_definition); |
385 $table_data[$views_field_name] = $this->mapSingleFieldViewsData($table, $field_name, $field_definition_type, $field_column_name, $field_schema['columns'][$field_column_name]['type'], $first, $field_definition); | 391 $table_data[$schema_field_name]['entity field'] = $field_name; |
386 | |
387 $table_data[$views_field_name]['entity field'] = $field_name; | |
388 $first = FALSE; | 392 $first = FALSE; |
389 } | 393 } |
390 } | 394 } |
391 | 395 |
392 /** | 396 /** |