You are here

public function WebformSubmissionStorage::getDefaultColumns in Webform 8.5

Same name and namespace in other branches
  1. 6.x src/WebformSubmissionStorage.php \Drupal\webform\WebformSubmissionStorage::getDefaultColumns()

Get default submission columns used to display results.

Parameters

\Drupal\webform\WebformInterface|null $webform: A webform.

\Drupal\Core\Entity\EntityInterface|null $source_entity: A webform submission source entity.

\Drupal\Core\Session\AccountInterface|null $account: A user account.

bool $include_elements: Flag that include all form element in the list of columns.

Return value

array An associative array of columns keyed by name.

Overrides WebformSubmissionStorageInterface::getDefaultColumns

1 call to WebformSubmissionStorage::getDefaultColumns()
WebformSubmissionStorage::getDefaultColumnNames in src/WebformSubmissionStorage.php
Get default submission columns used to display results.

File

src/WebformSubmissionStorage.php, line 636

Class

WebformSubmissionStorage
Defines the webform submission storage.

Namespace

Drupal\webform

Code

public function getDefaultColumns(WebformInterface $webform = NULL, EntityInterface $source_entity = NULL, AccountInterface $account = NULL, $include_elements = TRUE) {
  $columns = $this
    ->getColumns($webform, $source_entity, $account, $include_elements);

  // Unset columns.
  unset($columns['sid'], $columns['label'], $columns['uuid'], $columns['in_draft'], $columns['completed'], $columns['changed']);

  // Hide certain unnecessary columns, that have default set to FALSE.
  foreach ($columns as $column_name => $column) {
    if (isset($column['default']) && $column['default'] === FALSE) {
      unset($columns[$column_name]);
    }
  }
  return $columns;
}