]>
Commit | Line | Data |
---|---|---|
4f5b44bd NL |
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\Extension\Core\View; | |
13 | ||
14 | /** | |
15 | * Represents a choice in templates. | |
16 | * | |
17 | * @author Bernhard Schussek <bschussek@gmail.com> | |
18 | */ | |
19 | class ChoiceView | |
20 | { | |
21 | /** | |
22 | * The original choice value. | |
23 | * | |
24 | * @var mixed | |
25 | */ | |
26 | public $data; | |
27 | ||
28 | /** | |
29 | * The view representation of the choice. | |
30 | * | |
31 | * @var string | |
32 | */ | |
33 | public $value; | |
34 | ||
35 | /** | |
36 | * The label displayed to humans. | |
37 | * | |
38 | * @var string | |
39 | */ | |
40 | public $label; | |
41 | ||
42 | /** | |
43 | * Creates a new ChoiceView. | |
44 | * | |
45 | * @param mixed $data The original choice. | |
46 | * @param string $value The view representation of the choice. | |
47 | * @param string $label The label displayed to humans. | |
48 | */ | |
49 | public function __construct($data, $value, $label) | |
50 | { | |
51 | $this->data = $data; | |
52 | $this->value = $value; | |
53 | $this->label = $label; | |
54 | } | |
55 | } |