diff options
Diffstat (limited to 'vendor/symfony/form/Symfony/Component/Form/SubmitButton.php')
-rw-r--r-- | vendor/symfony/form/Symfony/Component/Form/SubmitButton.php | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/vendor/symfony/form/Symfony/Component/Form/SubmitButton.php b/vendor/symfony/form/Symfony/Component/Form/SubmitButton.php new file mode 100644 index 00000000..47d4be0e --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/SubmitButton.php | |||
@@ -0,0 +1,52 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of the Symfony package. | ||
5 | * | ||
6 | * (c) Fabien Potencier <fabien@symfony.com> | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | namespace Symfony\Component\Form; | ||
13 | |||
14 | /** | ||
15 | * A button that submits the form. | ||
16 | * | ||
17 | * @author Bernhard Schussek <bschussek@gmail.com> | ||
18 | */ | ||
19 | class SubmitButton extends Button implements ClickableInterface | ||
20 | { | ||
21 | /** | ||
22 | * @var Boolean | ||
23 | */ | ||
24 | private $clicked = false; | ||
25 | |||
26 | /** | ||
27 | * {@inheritdoc} | ||
28 | */ | ||
29 | public function isClicked() | ||
30 | { | ||
31 | return $this->clicked; | ||
32 | } | ||
33 | |||
34 | /** | ||
35 | * Submits data to the button. | ||
36 | * | ||
37 | * @param null|string $submittedData The data. | ||
38 | * @param Boolean $clearMissing Not used. | ||
39 | * | ||
40 | * @return SubmitButton The button instance | ||
41 | * | ||
42 | * @throws Exception\AlreadySubmittedException If the form has already been submitted. | ||
43 | */ | ||
44 | public function submit($submittedData, $clearMissing = true) | ||
45 | { | ||
46 | parent::submit($submittedData, $clearMissing); | ||
47 | |||
48 | $this->clicked = null !== $submittedData; | ||
49 | |||
50 | return $this; | ||
51 | } | ||
52 | } | ||