protected function TabularBaseWebformExporter::getFieldDefinitions in Webform 6.x
Same name and namespace in other branches
- 8.5 src/Plugin/WebformExporter/TabularBaseWebformExporter.php \Drupal\webform\Plugin\WebformExporter\TabularBaseWebformExporter::getFieldDefinitions()
Get a webform's field definitions.
Return value
array An associative array containing a webform's field definitions.
2 calls to TabularBaseWebformExporter::getFieldDefinitions()
- TabularBaseWebformExporter::buildHeader in src/
Plugin/ WebformExporter/ TabularBaseWebformExporter.php - Build export header using webform submission field definitions and webform element columns.
- TabularBaseWebformExporter::buildRecord in src/
Plugin/ WebformExporter/ TabularBaseWebformExporter.php - Build export record using a webform submission.
File
- src/
Plugin/ WebformExporter/ TabularBaseWebformExporter.php, line 179
Class
- TabularBaseWebformExporter
- Defines abstract tabular exporter used to build CSV files and HTML tables.
Namespace
Drupal\webform\Plugin\WebformExporterCode
protected function getFieldDefinitions() {
if (isset($this->fieldDefinitions)) {
return $this->fieldDefinitions;
}
$export_options = $this
->getConfiguration();
$this->fieldDefinitions = $this
->getSubmissionStorage()
->getFieldDefinitions();
$this->fieldDefinitions = $this
->getSubmissionStorage()
->checkFieldDefinitionAccess($this
->getWebform(), $this->fieldDefinitions);
if ($export_options['excluded_columns']) {
$this->fieldDefinitions = array_diff_key($this->fieldDefinitions, $export_options['excluded_columns']);
}
// Add custom entity reference field definitions which rely on the
// entity type and entity id.
if (isset($this->fieldDefinitions['entity_type']) && isset($this->fieldDefinitions['entity_id'])) {
$this->fieldDefinitions['entity_title'] = [
'name' => 'entity_title',
'title' => $this
->t('Submitted to: Entity title'),
'type' => 'entity_title',
];
$this->fieldDefinitions['entity_url'] = [
'name' => 'entity_url',
'title' => $this
->t('Submitted to: Entity URL'),
'type' => 'entity_url',
];
}
return $this->fieldDefinitions;
}