3 namespace Drupal\ctools_wizard_test\Wizard;
5 use Drupal\ctools\Wizard\EntityFormWizardBase;
7 class EntityEditWizardTest extends EntityFormWizardBase {
12 public function getWizardLabel() {
13 return $this->t('Example entity');
19 public function getMachineLabel() {
20 return $this->t('Label');
26 public function getEntityType() {
27 return 'ctools_wizard_test_config_entity';
33 public function exists() {
34 return '\Drupal\ctools_wizard_test\Entity\ExampleConfigEntity::load';
40 public function getOperations($cached_values) {
41 /** @var $page \Drupal\ctools_wizard_test\Entity\ExampleConfigEntity */
42 $config_entity = $cached_values['ctools_wizard_test_config_entity'];
46 'form' => 'Drupal\ctools_wizard_test\Form\ExampleConfigEntityGeneralForm',
47 'title' => $this->t('General'),
50 'form' => 'Drupal\ctools_wizard_test\Form\ExampleConfigEntityOneForm',
51 'title' => $this->t('Form One'),
54 'form' => 'Drupal\ctools_wizard_test\Form\ExampleConfigEntityTwoForm',
55 'title' => $this->t('Form Two'),
59 // To test that we can get the config entity and add/remove steps
60 // based on it's values, we'll add a special step only when the entity
62 if (!empty($config_entity) && !$config_entity->isNew()) {
63 $steps['existing'] = [
64 'form' => 'Drupal\ctools_wizard_test\Form\ExampleConfigEntityExistingForm',
65 'title' => $this->t('Existing entity'),