Merge pull request #23174 from braders/nodefaults-contrib-links
[civicrm-core.git] / CRM / Import / Forms.php
1 <?php
2 /*
3 +--------------------------------------------------------------------+
4 | Copyright CiviCRM LLC. All rights reserved. |
5 | |
6 | This work is published under the GNU AGPLv3 license with some |
7 | permitted exceptions and without any warranty. For full license |
8 | and copyright information, see https://civicrm.org/licensing |
9 +--------------------------------------------------------------------+
10 */
11
12 /**
13 *
14 * @package CRM
15 * @copyright CiviCRM LLC https://civicrm.org/licensing
16 */
17
18 /**
19 * This class helps the forms within the import flow access submitted & parsed values.
20 */
21 class CRM_Import_Forms extends CRM_Core_Form {
22
23 /**
24 * Get the submitted value, accessing it from whatever form in the flow it is submitted on.
25 * @param string $fieldName
26 *
27 * @return mixed|null
28 */
29 public function getSubmittedValue(string $fieldName) {
30 $mappedValues = [
31 'skipColumnHeader' => 'DataSource',
32 ];
33 if (array_key_exists($fieldName, $mappedValues)) {
34 return $this->controller->exportValue($mappedValues[$fieldName], $fieldName);
35 }
36 return parent::getSubmittedValue($fieldName);
37
38 }
39
40 }