@@ -28,6 +28,9 @@ discard block |
||
| 28 | 28 | */ |
| 29 | 29 | private static $currency_symbol = '$'; |
| 30 | 30 | |
| 31 | + /** |
|
| 32 | + * @param string $name |
|
| 33 | + */ |
|
| 31 | 34 | public function __construct($name = null, $wholeSize = 9, $decimalSize = 2, $defaultValue = 0) { |
| 32 | 35 | parent::__construct($name, $wholeSize, $decimalSize, $defaultValue); |
| 33 | 36 | } |
@@ -51,6 +54,9 @@ discard block |
||
| 51 | 54 | else return $val; |
| 52 | 55 | } |
| 53 | 56 | |
| 57 | + /** |
|
| 58 | + * @param string $value |
|
| 59 | + */ |
|
| 54 | 60 | public function setValue($value, $record = null, $markChanged = true) { |
| 55 | 61 | $matches = null; |
| 56 | 62 | if(is_numeric($value)) { |
@@ -31,6 +31,9 @@ discard block |
||
| 31 | 31 | */ |
| 32 | 32 | class DBDate extends DBField { |
| 33 | 33 | |
| 34 | + /** |
|
| 35 | + * @param string $value |
|
| 36 | + */ |
|
| 34 | 37 | public function setValue($value, $record = null, $markChanged = true) { |
| 35 | 38 | if($value === false || $value === null || (is_string($value) && !strlen($value))) { |
| 36 | 39 | // don't try to evaluate empty values with strtotime() below, as it returns "1970-01-01" when it should be |
@@ -113,7 +116,7 @@ discard block |
||
| 113 | 116 | |
| 114 | 117 | /** |
| 115 | 118 | * Returns the day of the month. |
| 116 | - * @param boolean $includeOrdinals Include ordinal suffix to day, e.g. "th" or "rd" |
|
| 119 | + * @param boolean $includeOrdinal Include ordinal suffix to day, e.g. "th" or "rd" |
|
| 117 | 120 | * @return string |
| 118 | 121 | */ |
| 119 | 122 | public function DayOfMonth($includeOrdinal = false) { |
@@ -108,7 +108,7 @@ |
||
| 108 | 108 | * Return a date and time formatted as per a CMS user's settings. |
| 109 | 109 | * |
| 110 | 110 | * @param Member $member |
| 111 | - * @return boolean | string A time and date pair formatted as per user-defined settings. |
|
| 111 | + * @return false|string | string A time and date pair formatted as per user-defined settings. |
|
| 112 | 112 | */ |
| 113 | 113 | public function FormatFromSettings($member = null) { |
| 114 | 114 | require_once 'Zend/Date.php'; |
@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | * @param string $name |
| 22 | 22 | * @param int $wholeSize |
| 23 | 23 | * @param int $decimalSize |
| 24 | - * @param float $defaultValue |
|
| 24 | + * @param integer $defaultValue |
|
| 25 | 25 | */ |
| 26 | 26 | public function __construct($name = null, $wholeSize = 9, $decimalSize = 2, $defaultValue = 0) { |
| 27 | 27 | $this->wholeSize = is_int($wholeSize) ? $wholeSize : 9; |
@@ -33,14 +33,14 @@ discard block |
||
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | /** |
| 36 | - * @return float |
|
| 36 | + * @return string |
|
| 37 | 37 | */ |
| 38 | 38 | public function Nice() { |
| 39 | 39 | return number_format($this->value, $this->decimalSize); |
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | /** |
| 43 | - * @return int |
|
| 43 | + * @return double |
|
| 44 | 44 | */ |
| 45 | 45 | public function Int() { |
| 46 | 46 | return floor($this->value); |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | /** |
| 89 | - * @return float |
|
| 89 | + * @return integer |
|
| 90 | 90 | */ |
| 91 | 91 | public function nullValue() { |
| 92 | 92 | return 0; |
@@ -236,7 +236,7 @@ discard block |
||
| 236 | 236 | /** |
| 237 | 237 | * Get the table this field belongs to, if assigned |
| 238 | 238 | * |
| 239 | - * @return string|null |
|
| 239 | + * @return string |
|
| 240 | 240 | */ |
| 241 | 241 | public function getTable() { |
| 242 | 242 | return $this->tableName; |
@@ -293,6 +293,7 @@ discard block |
||
| 293 | 293 | |
| 294 | 294 | /** |
| 295 | 295 | * Saves this field to the given data object. |
| 296 | + * @param \DataObject $dataObject |
|
| 296 | 297 | */ |
| 297 | 298 | public function saveInto($dataObject) { |
| 298 | 299 | $fieldName = $this->name; |
@@ -310,7 +311,7 @@ discard block |
||
| 310 | 311 | * Used by {@link SearchContext}, {@link ModelAdmin}, {@link DataObject::scaffoldFormFields()} |
| 311 | 312 | * |
| 312 | 313 | * @param string $title Optional. Localized title of the generated instance |
| 313 | - * @return FormField |
|
| 314 | + * @return TextField |
|
| 314 | 315 | */ |
| 315 | 316 | public function scaffoldFormField($title = null) { |
| 316 | 317 | $field = new TextField($this->name, $title); |
@@ -325,7 +326,7 @@ discard block |
||
| 325 | 326 | * Used by {@link SearchContext}, {@link ModelAdmin}, {@link DataObject::scaffoldFormFields()}. |
| 326 | 327 | * |
| 327 | 328 | * @param string $title Optional. Localized title of the generated instance |
| 328 | - * @return FormField |
|
| 329 | + * @return TextField |
|
| 329 | 330 | */ |
| 330 | 331 | public function scaffoldSearchField($title = null) { |
| 331 | 332 | return $this->scaffoldFormField($title); |
@@ -47,6 +47,9 @@ |
||
| 47 | 47 | |
| 48 | 48 | protected $whitelist = false; |
| 49 | 49 | |
| 50 | + /** |
|
| 51 | + * @param string $name |
|
| 52 | + */ |
|
| 50 | 53 | public function __construct($name = null, $options = array()) { |
| 51 | 54 | if(is_string($options)) { |
| 52 | 55 | $options = array('whitelist' => $options); |
@@ -101,6 +101,7 @@ discard block |
||
| 101 | 101 | |
| 102 | 102 | /** |
| 103 | 103 | * @param string |
| 104 | + * @param string|null $currency |
|
| 104 | 105 | */ |
| 105 | 106 | public function setCurrency($currency, $markChanged = true) { |
| 106 | 107 | $this->setField('Currency', $currency, $markChanged); |
@@ -151,6 +152,8 @@ discard block |
||
| 151 | 152 | } |
| 152 | 153 | |
| 153 | 154 | /** |
| 155 | + * @param string $currency |
|
| 156 | + * @param string $locale |
|
| 154 | 157 | * @return string |
| 155 | 158 | */ |
| 156 | 159 | public function getSymbol($currency = null, $locale = null) { |
@@ -162,6 +165,8 @@ discard block |
||
| 162 | 165 | } |
| 163 | 166 | |
| 164 | 167 | /** |
| 168 | + * @param string $currency |
|
| 169 | + * @param string $locale |
|
| 165 | 170 | * @return string |
| 166 | 171 | */ |
| 167 | 172 | public function getShortName($currency = null, $locale = null) { |
@@ -172,6 +177,8 @@ discard block |
||
| 172 | 177 | } |
| 173 | 178 | |
| 174 | 179 | /** |
| 180 | + * @param string $currency |
|
| 181 | + * @param string $locale |
|
| 175 | 182 | * @return string |
| 176 | 183 | */ |
| 177 | 184 | public function getCurrencyName($currency = null, $locale = null) { |
@@ -202,7 +209,7 @@ discard block |
||
| 202 | 209 | * Used by {@link SearchContext}, {@link ModelAdmin}, {@link DataObject::scaffoldFormFields()} |
| 203 | 210 | * |
| 204 | 211 | * @param string $title Optional. Localized title of the generated instance |
| 205 | - * @return FormField |
|
| 212 | + * @return MoneyField |
|
| 206 | 213 | */ |
| 207 | 214 | public function scaffoldFormField($title = null) { |
| 208 | 215 | $field = new MoneyField($this->getName()); |
@@ -2,7 +2,6 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace SilverStripe\Model\FieldType; |
| 4 | 4 | |
| 5 | -use DB; |
|
| 6 | 5 | use i18n; |
| 7 | 6 | use Zend_Currency; |
| 8 | 7 | use MoneyField; |
@@ -2,9 +2,7 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace SilverStripe\Model\FieldType; |
| 4 | 4 | |
| 5 | -use DB; |
|
| 6 | 5 | use DataObject; |
| 7 | -use ClassInfo; |
|
| 8 | 6 | |
| 9 | 7 | /** |
| 10 | 8 | * A special ForeignKey class that handles relations with arbitrary class types |
@@ -2,8 +2,6 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace SilverStripe\Model\FieldType; |
| 4 | 4 | |
| 5 | -use DataList; |
|
| 6 | -use DropdownField; |
|
| 7 | 5 | use DB; |
| 8 | 6 | use DataObject; |
| 9 | 7 | |