You are here

protected function YamlFormTestTrait::getExportColumns in YAML Form 8

Get form export columns.

Parameters

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

Return value

array An array of exportable columns.

1 call to YamlFormTestTrait::getExportColumns()
YamlFormElementTableTest::test in src/Tests/YamlFormElementTableTest.php
Tests building of options elements.

File

src/Tests/YamlFormTestTrait.php, line 417

Class

YamlFormTestTrait
Defines form test trait.

Namespace

Drupal\yamlform\Tests

Code

protected function getExportColumns(YamlFormInterface $yamlform) {

  /** @var \Drupal\yamlform\YamlFormSubmissionStorageInterface $submission_storage */
  $submission_storage = \Drupal::entityTypeManager()
    ->getStorage('yamlform_submission');
  $columns = array_merge(array_keys($submission_storage
    ->getFieldDefinitions()), array_keys($yamlform
    ->getElementsInitializedAndFlattened()));
  return array_combine($columns, $columns);
}