aboutsummaryrefslogtreecommitdiffhomepage
path: root/vendor/symfony/form/Symfony/Component/Form/FormEvent.php
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/symfony/form/Symfony/Component/Form/FormEvent.php')
-rw-r--r--vendor/symfony/form/Symfony/Component/Form/FormEvent.php65
1 files changed, 65 insertions, 0 deletions
diff --git a/vendor/symfony/form/Symfony/Component/Form/FormEvent.php b/vendor/symfony/form/Symfony/Component/Form/FormEvent.php
new file mode 100644
index 00000000..57cebade
--- /dev/null
+++ b/vendor/symfony/form/Symfony/Component/Form/FormEvent.php
@@ -0,0 +1,65 @@
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
12namespace Symfony\Component\Form;
13
14use Symfony\Component\EventDispatcher\Event;
15
16/**
17 * @author Bernhard Schussek <bschussek@gmail.com>
18 */
19class FormEvent extends Event
20{
21 private $form;
22 protected $data;
23
24 /**
25 * Constructs an event.
26 *
27 * @param FormInterface $form The associated form
28 * @param mixed $data The data
29 */
30 public function __construct(FormInterface $form, $data)
31 {
32 $this->form = $form;
33 $this->data = $data;
34 }
35
36 /**
37 * Returns the form at the source of the event.
38 *
39 * @return FormInterface
40 */
41 public function getForm()
42 {
43 return $this->form;
44 }
45
46 /**
47 * Returns the data associated with this event.
48 *
49 * @return mixed
50 */
51 public function getData()
52 {
53 return $this->data;
54 }
55
56 /**
57 * Allows updating with some filtered data.
58 *
59 * @param mixed $data
60 */
61 public function setData($data)
62 {
63 $this->data = $data;
64 }
65}