You are here

public function YamlFormSubmissionStorage::getDefaultColumns in YAML Form 8

Get default submission columns used to display results.

Parameters

\Drupal\yamlform\YamlFormInterface|null $yamlform: A form.

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

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

Return value

array|mixed An associative array of columns keyed by name.

Overrides YamlFormSubmissionStorageInterface::getDefaultColumns

1 call to YamlFormSubmissionStorage::getDefaultColumns()
YamlFormSubmissionStorage::getCustomColumns in src/YamlFormSubmissionStorage.php
Get customized submission columns used to display custom table.

File

src/YamlFormSubmissionStorage.php, line 304

Class

YamlFormSubmissionStorage
Defines the form submission storage.

Namespace

Drupal\yamlform

Code

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

  // 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;
}