-
Notifications
You must be signed in to change notification settings - Fork 126
Expand file tree
/
Copy pathCreateTopicFlow.php
More file actions
76 lines (64 loc) · 1.61 KB
/
Copy pathCreateTopicFlow.php
File metadata and controls
76 lines (64 loc) · 1.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<?php
namespace Craue\FormFlowBundle\Tests\IntegrationTestBundle\Form;
use Craue\FormFlowBundle\Form\FormFlow;
use Craue\FormFlowBundle\Form\FormFlowInterface;
use Symfony\Component\Form\FormTypeInterface;
/**
* @author Christian Raue <christian.raue@gmail.com>
* @copyright 2011-2015 Christian Raue
* @license http://opensource.org/licenses/mit-license.php MIT License
*/
class CreateTopicFlow extends FormFlow {
protected $allowDynamicStepNavigation = true;
/**
* @var FormTypeInterface
*/
protected $formType;
/**
* @param FormTypeInterface $formType
*/
public function setFormType(FormTypeInterface $formType) {
$this->formType = $formType;
}
/**
* {@inheritDoc}
*/
public function getName() {
return 'createTopic';
}
/**
* {@inheritDoc}
*/
protected function loadStepsConfig() {
return array(
array(
'label' => 'basics',
'form_type' => $this->formType,
),
array(
'label' => 'comment',
'form_type' => $this->formType,
),
array(
'label' => 'bug_details',
'form_type' => $this->formType,
'skip' => function($estimatedCurrentStepNumber, FormFlowInterface $flow) {
return $estimatedCurrentStepNumber > 1 && !$flow->getFormData()->isBugReport();
},
),
array(
'label' => 'confirmation',
),
);
}
/**
* {@inheritDoc}
*/
public function getFormOptions($step, array $options = array()) {
$options = parent::getFormOptions($step, $options);
if ($step === 3) {
$options['isBugReport'] = $this->getFormData()->isBugReport();
}
return $options;
}
}