Merge pull request #18739 from eileenmcnaughton/ef
[civicrm-core.git] / CRM / Export / StateMachine / Standalone.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 class CRM_Export_StateMachine_Standalone extends CRM_Core_StateMachine {
18
19 /**
20 * Class constructor.
21 *
22 * @param object $controller
23 * @param \const|int $action
24 * @param string $entity
25 */
26 public function __construct($controller, $action = CRM_Core_Action::NONE, $entity = 'Contact') {
27 parent::__construct($controller, $action);
28
29 $entityMap = ['Contribution' => 'Contribute', 'Membership' => 'Member', 'Participant' => 'Event'];
30 $entity = $entityMap[$entity] ?? $entity;
31 $this->_pages = [
32 'CRM_' . $entity . '_Export_Form_Select' => NULL,
33 'CRM_' . $entity . '_Export_Form_Map' => NULL,
34 ];
35
36 $this->addSequentialPages($this->_pages, $action);
37 }
38
39 /**
40 * @todo So far does nothing.
41 *
42 * @return string
43 */
44 public function getTaskFormName() {
45 return '';
46 }
47
48 /**
49 * @todo not sure if this is needed
50 */
51 public function shouldReset() {
52 return FALSE;
53 }
54
55 }