Merge pull request #23797 from eileenmcnaughton/remove_field_types
[civicrm-core.git] / CRM / Import / StateMachine.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 * State machine for managing different states of the Import process.
20 */
21 class CRM_Import_StateMachine extends CRM_Core_StateMachine {
22
23 /**
24 * Class constructor.
25 *
26 * @param object $controller
27 * @param \const|int $action
28 */
29 public function __construct($controller, $action = CRM_Core_Action::NONE) {
30 parent::__construct($controller, $action);
31
32 $classType = str_replace('_Controller', '', get_class($controller));
33 $this->_pages = [
34 $classType . '_Form_DataSource' => NULL,
35 $classType . '_Form_MapField' => NULL,
36 $classType . '_Form_Preview' => NULL,
37 $classType . '_Form_Summary' => NULL,
38 ];
39
40 $this->addSequentialPages($this->_pages, $action);
41 }
42
43 }