@@ -14,6 +14,7 @@ discard block |
||
14 | 14 | /** |
15 | 15 | * allows the value to be set. removes the first character |
16 | 16 | * if it is not a number (probably a currency symbol) |
17 | + * @param string $val |
|
17 | 18 | */ |
18 | 19 | public function setValue($val) { |
19 | 20 | if(!$val) $val = 0.00; |
@@ -43,6 +44,9 @@ discard block |
||
43 | 44 | return $this->castedCopy('CurrencyField_Readonly'); |
44 | 45 | } |
45 | 46 | |
47 | + /** |
|
48 | + * @param RequiredFields $validator |
|
49 | + */ |
|
46 | 50 | public function validate($validator) { |
47 | 51 | $currencySymbol = preg_quote(Config::inst()->get('SilverStripe\\ORM\\FieldType\\DBCurrency', 'currency_symbol')); |
48 | 52 | $regex = '/^\s*(\-?'.$currencySymbol.'?|'.$currencySymbol.'\-?)?(\d{1,3}(\,\d{3})*|(\d+))(\.\d{2})?\s*$/'; |
@@ -63,6 +63,10 @@ discard block |
||
63 | 63 | */ |
64 | 64 | protected $config; |
65 | 65 | |
66 | + /** |
|
67 | + * @param string $name |
|
68 | + * @param string $title |
|
69 | + */ |
|
66 | 70 | public function __construct($name, $title = null, $value = ""){ |
67 | 71 | $this->config = $this->config()->default_config; |
68 | 72 | |
@@ -75,6 +79,9 @@ discard block |
||
75 | 79 | parent::__construct($name, $title, $value); |
76 | 80 | } |
77 | 81 | |
82 | + /** |
|
83 | + * @param Form $form |
|
84 | + */ |
|
78 | 85 | public function setForm($form) { |
79 | 86 | parent::setForm($form); |
80 | 87 | |
@@ -85,6 +92,9 @@ discard block |
||
85 | 92 | return $this; |
86 | 93 | } |
87 | 94 | |
95 | + /** |
|
96 | + * @param string $name |
|
97 | + */ |
|
88 | 98 | public function setName($name) { |
89 | 99 | parent::setName($name); |
90 | 100 | |
@@ -97,7 +107,7 @@ discard block |
||
97 | 107 | |
98 | 108 | /** |
99 | 109 | * @param array $properties |
100 | - * @return string |
|
110 | + * @return DBHTMLText |
|
101 | 111 | */ |
102 | 112 | public function FieldHolder($properties = array()) { |
103 | 113 | $config = array( |
@@ -249,6 +259,7 @@ discard block |
||
249 | 259 | |
250 | 260 | /** |
251 | 261 | * @param FormField |
262 | + * @param DateField $field |
|
252 | 263 | */ |
253 | 264 | public function setDateField($field) { |
254 | 265 | $expected = $this->getName() . '[date]'; |
@@ -274,6 +285,7 @@ discard block |
||
274 | 285 | |
275 | 286 | /** |
276 | 287 | * @param FormField |
288 | + * @param TimeField $field |
|
277 | 289 | */ |
278 | 290 | public function setTimeField($field) { |
279 | 291 | $expected = $this->getName() . '[time]'; |
@@ -312,7 +324,7 @@ discard block |
||
312 | 324 | * to set field-specific config options. |
313 | 325 | * |
314 | 326 | * @param string $name |
315 | - * @param mixed $val |
|
327 | + * @param string $val |
|
316 | 328 | */ |
317 | 329 | public function setConfig($name, $val) { |
318 | 330 | $this->config[$name] = $val; |
@@ -330,7 +342,7 @@ discard block |
||
330 | 342 | * to get field-specific config options. |
331 | 343 | * |
332 | 344 | * @param String $name Optional, returns the whole configuration array if empty |
333 | - * @return mixed |
|
345 | + * @return string|null |
|
334 | 346 | */ |
335 | 347 | public function getConfig($name = null) { |
336 | 348 | if($name) { |
@@ -340,6 +352,9 @@ discard block |
||
340 | 352 | } |
341 | 353 | } |
342 | 354 | |
355 | + /** |
|
356 | + * @param RequiredFields $validator |
|
357 | + */ |
|
343 | 358 | public function validate($validator) { |
344 | 359 | $dateValid = $this->dateField->validate($validator); |
345 | 360 | $timeValid = $this->timeField->validate($validator); |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | |
88 | 88 | /** |
89 | 89 | * @param array $properties |
90 | - * @return string |
|
90 | + * @return DBHTMLText |
|
91 | 91 | */ |
92 | 92 | public function Field($properties = array()) { |
93 | 93 | $properties = array_merge($properties, array( |
@@ -251,7 +251,6 @@ discard block |
||
251 | 251 | * for each of these categories |
252 | 252 | * |
253 | 253 | * @param string $category Category name |
254 | - * @param string,... $categories Additional category names |
|
255 | 254 | * @return $this |
256 | 255 | */ |
257 | 256 | public function setAllowedFileCategories($category) { |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | |
94 | 94 | /** |
95 | 95 | * @param array $properties |
96 | - * @return string |
|
96 | + * @return DBHTMLText |
|
97 | 97 | */ |
98 | 98 | public function Field($properties = array()) { |
99 | 99 | $properties = array_merge( |
@@ -158,6 +158,7 @@ discard block |
||
158 | 158 | * Enable or disable the rendering of this action as a <button /> |
159 | 159 | * |
160 | 160 | * @param boolean |
161 | + * @param boolean $bool |
|
161 | 162 | * @return $this |
162 | 163 | */ |
163 | 164 | public function setUseButtonTag($bool) { |
@@ -647,6 +647,7 @@ discard block |
||
647 | 647 | * |
648 | 648 | * Caution: this doesn't work on all fields, see {@link setAttribute()}. |
649 | 649 | * |
650 | + * @param string $name |
|
650 | 651 | * @return null|string |
651 | 652 | */ |
652 | 653 | public function getAttribute($name) { |
@@ -758,7 +759,6 @@ discard block |
||
758 | 759 | * Set the field value. |
759 | 760 | * |
760 | 761 | * @param mixed $value |
761 | - * @param null|array|DataObject $data {@see Form::loadDataFrom} |
|
762 | 762 | * |
763 | 763 | * @return $this |
764 | 764 | */ |
@@ -1239,6 +1239,7 @@ discard block |
||
1239 | 1239 | * @todo Make this abstract. |
1240 | 1240 | * |
1241 | 1241 | * @param Validator |
1242 | + * @param RequiredFields $validator |
|
1242 | 1243 | * |
1243 | 1244 | * @return bool |
1244 | 1245 | */ |
@@ -1286,7 +1287,7 @@ discard block |
||
1286 | 1287 | * This function is used by the template processor. If you refer to a field as a $ variable, it |
1287 | 1288 | * will return the $Field value. |
1288 | 1289 | * |
1289 | - * @return string |
|
1290 | + * @return DBHTMLText |
|
1290 | 1291 | */ |
1291 | 1292 | public function forTemplate() { |
1292 | 1293 | return $this->Field(); |
@@ -1308,7 +1309,7 @@ discard block |
||
1308 | 1309 | * |
1309 | 1310 | * @param FieldList $containerFieldList |
1310 | 1311 | * |
1311 | - * @return FieldList |
|
1312 | + * @return FormField |
|
1312 | 1313 | */ |
1313 | 1314 | public function setContainerFieldList($containerFieldList) { |
1314 | 1315 | $this->containerFieldList = $containerFieldList; |
@@ -1471,7 +1472,7 @@ discard block |
||
1471 | 1472 | * Any passed keys that are not defined in {@link getSchemaDataDefaults()} are ignored. |
1472 | 1473 | * If you want to pass around ad hoc data use the `data` array e.g. pass `['data' => ['myCustomKey' => 'yolo']]`. |
1473 | 1474 | * |
1474 | - * @param array $schemaData - The data to be merged with $this->schemaData. |
|
1475 | + * @param array $schemaState - The data to be merged with $this->schemaData. |
|
1475 | 1476 | * @return FormField |
1476 | 1477 | * |
1477 | 1478 | * @todo Add deep merging of arrays like `data` and `attributes`. |
@@ -12,7 +12,7 @@ |
||
12 | 12 | |
13 | 13 | /** |
14 | 14 | * @param array $properties |
15 | - * @return string |
|
15 | + * @return DBHTMLText |
|
16 | 16 | */ |
17 | 17 | public function FieldHolder($properties = array()) { |
18 | 18 | return $this->Field($properties); |
@@ -24,7 +24,7 @@ |
||
24 | 24 | * |
25 | 25 | * @param array $properties |
26 | 26 | * |
27 | - * @return string |
|
27 | + * @return SilverStripe\ORM\FieldType\DBHTMLText |
|
28 | 28 | */ |
29 | 29 | public function Field($properties = array()) { |
30 | 30 | $source = ArrayLib::flatten($this->getSource()); |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | /** |
85 | 85 | * Set the label used for the Is Null checkbox. |
86 | 86 | * |
87 | - * @param $isNulLabel string |
|
87 | + * @param string $isNulLabel string |
|
88 | 88 | * |
89 | 89 | * @return $this |
90 | 90 | */ |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | /** |
129 | 129 | * Value is sometimes an array, and sometimes a single value, so we need to handle both cases |
130 | 130 | * |
131 | - * @param mixed $value |
|
131 | + * @param string|null $value |
|
132 | 132 | * @param null|array $data |
133 | 133 | * |
134 | 134 | * @return $this |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | * |
81 | 81 | * @param string $name the field name |
82 | 82 | * @param string $title the field label |
83 | - * @param string|array $sourceObject The object-type to list in the tree. This could |
|
83 | + * @param string $sourceObject The object-type to list in the tree. This could |
|
84 | 84 | * be one of the following: |
85 | 85 | * - A DataObject class name with the {@link Hierarchy} extension. |
86 | 86 | * - An array of key/value pairs, like a {@link DropdownField} source. In |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | |
217 | 217 | /** |
218 | 218 | * @param array $properties |
219 | - * @return string |
|
219 | + * @return DBHTMLText |
|
220 | 220 | */ |
221 | 221 | public function Field($properties = array()) { |
222 | 222 | Requirements::add_i18n_javascript(FRAMEWORK_DIR . '/client/lang'); |