1 | <?php |
||
41 | class Field extends Element |
||
42 | { |
||
43 | /** |
||
44 | * A flag for setting the required state of the form. If this value |
||
45 | * is set as true then the form would not be validated if there is |
||
46 | * no value entered into this field. |
||
47 | */ |
||
48 | public $required = false; |
||
49 | |||
50 | /** |
||
51 | * The value of the form field. |
||
52 | */ |
||
53 | protected $value; |
||
54 | |||
55 | /** |
||
56 | * The constructor for the field element. |
||
57 | */ |
||
58 | public function __construct($name="", $value="") |
||
63 | |||
64 | /** |
||
65 | * Sets the value of the field. |
||
66 | * |
||
67 | * @param $value The value of the field. |
||
68 | * @return Field |
||
69 | */ |
||
70 | public function setValue($value) |
||
75 | |||
76 | /** |
||
77 | * Get the value of the field. |
||
78 | * |
||
79 | * @return unknown |
||
|
|||
80 | */ |
||
81 | public function getValue() |
||
85 | |||
86 | /** |
||
87 | * Sets the required status of the field. |
||
88 | * |
||
89 | * @param The required status of the field. |
||
90 | */ |
||
91 | public function setRequired($required) |
||
96 | |||
97 | /** |
||
98 | * Returns the required status of the field. |
||
99 | * |
||
100 | * @return The required status of the field. |
||
101 | */ |
||
102 | public function getRequired() |
||
106 | |||
107 | //! Sets the data that is stored in this field. |
||
108 | //! \param $data An array of fields. This method just looks through for |
||
109 | //! a field that matches it and then applies its value to |
||
110 | //! itself. |
||
111 | public function setData($data) |
||
118 | |||
119 | public function getType() |
||
123 | |||
124 | public function getCSSClasses() |
||
131 | |||
132 | public function render() |
||
138 | } |
||
139 |
This check compares the return type specified in the
@return
annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.