@@ -120,6 +120,9 @@ discard block |
||
| 120 | 120 | Requirements::javascript(FRAMEWORK_ADMIN_DIR . '/javascript/ModelAdmin.js'); |
| 121 | 121 | } |
| 122 | 122 | |
| 123 | + /** |
|
| 124 | + * @param string $action |
|
| 125 | + */ |
|
| 123 | 126 | public function Link($action = null) { |
| 124 | 127 | if(!$action) $action = $this->sanitiseClassName($this->modelClass); |
| 125 | 128 | return parent::Link($action); |
@@ -219,6 +222,9 @@ discard block |
||
| 219 | 222 | return $form; |
| 220 | 223 | } |
| 221 | 224 | |
| 225 | + /** |
|
| 226 | + * @return GridFieldComponent |
|
| 227 | + */ |
|
| 222 | 228 | public function getList() { |
| 223 | 229 | $context = $this->getSearchContext(); |
| 224 | 230 | $params = $this->getRequest()->requestVar('q'); |
@@ -274,6 +280,7 @@ discard block |
||
| 274 | 280 | |
| 275 | 281 | /** |
| 276 | 282 | * Unsanitise a model class' name from a URL param |
| 283 | + * @param string $class |
|
| 277 | 284 | * @return string |
| 278 | 285 | */ |
| 279 | 286 | protected function unsanitiseClassName($class) { |
@@ -414,7 +421,7 @@ discard block |
||
| 414 | 421 | * @param array $data |
| 415 | 422 | * @param Form $form |
| 416 | 423 | * @param SS_HTTPRequest $request |
| 417 | - * @return bool|null |
|
| 424 | + * @return false|null |
|
| 418 | 425 | */ |
| 419 | 426 | public function import($data, $form, $request) { |
| 420 | 427 | if(!$this->showImportForm || (is_array($this->showImportForm) |
@@ -470,11 +470,17 @@ discard block |
||
| 470 | 470 | |
| 471 | 471 | protected $extraConfigSources = array(); |
| 472 | 472 | |
| 473 | + /** |
|
| 474 | + * @param string $class |
|
| 475 | + */ |
|
| 473 | 476 | public function extraConfigSourcesChanged($class) { |
| 474 | 477 | unset($this->extraConfigSources[$class]); |
| 475 | 478 | $this->cache->clean("__{$class}"); |
| 476 | 479 | } |
| 477 | 480 | |
| 481 | + /** |
|
| 482 | + * @param integer $sourceOptions |
|
| 483 | + */ |
|
| 478 | 484 | protected function getUncached($class, $name, $sourceOptions, &$result, $suppress, &$tags) { |
| 479 | 485 | $tags[] = "__{$class}"; |
| 480 | 486 | $tags[] = "__{$class}__{$name}"; |
@@ -648,15 +654,6 @@ discard block |
||
| 648 | 654 | * |
| 649 | 655 | * @param string $class The class to remove a configuration value from |
| 650 | 656 | * @param string $name The configuration name |
| 651 | - * @param mixed $key An optional key to filter against. |
|
| 652 | - * If referenced config value is an array, only members of that array that match this key will be removed |
|
| 653 | - * Must also match value if provided to be removed |
|
| 654 | - * @param mixed $value And optional value to filter against. |
|
| 655 | - * If referenced config value is an array, only members of that array that match this value will be removed |
|
| 656 | - * If referenced config value is not an array, value will be removed only if it matches this argument |
|
| 657 | - * Must also match key if provided and referenced config value is an array to be removed |
|
| 658 | - * |
|
| 659 | - * Matching is always by "==", not by "===" |
|
| 660 | 657 | */ |
| 661 | 658 | public function remove($class, $name /*,$key = null*/ /*,$value = null*/) { |
| 662 | 659 | $argc = func_num_args(); |
@@ -735,6 +732,10 @@ discard block |
||
| 735 | 732 | $this->cache = $cloned; |
| 736 | 733 | } |
| 737 | 734 | |
| 735 | + /** |
|
| 736 | + * @param integer $key |
|
| 737 | + * @param integer $val |
|
| 738 | + */ |
|
| 738 | 739 | public function set($key, $val, $tags = array()) { |
| 739 | 740 | // Find an index to set at |
| 740 | 741 | $replacing = null; |
@@ -803,6 +804,9 @@ discard block |
||
| 803 | 804 | } |
| 804 | 805 | } |
| 805 | 806 | |
| 807 | + /** |
|
| 808 | + * @param string $tag |
|
| 809 | + */ |
|
| 806 | 810 | public function clean($tag = null) { |
| 807 | 811 | if ($tag) { |
| 808 | 812 | foreach ($this->cache as $i => $v) { |
@@ -834,6 +838,10 @@ discard block |
||
| 834 | 838 | $this->cache = array(); |
| 835 | 839 | } |
| 836 | 840 | |
| 841 | + /** |
|
| 842 | + * @param integer $key |
|
| 843 | + * @param integer $val |
|
| 844 | + */ |
|
| 837 | 845 | public function set($key, $val, $tags = array()) { |
| 838 | 846 | foreach($tags as $t) { |
| 839 | 847 | if(!isset($this->tags[$t])) { |
@@ -852,6 +860,9 @@ discard block |
||
| 852 | 860 | return $this->miss ? ($this->hit / $this->miss) : 0; |
| 853 | 861 | } |
| 854 | 862 | |
| 863 | + /** |
|
| 864 | + * @param integer $key |
|
| 865 | + */ |
|
| 855 | 866 | public function get($key) { |
| 856 | 867 | list($hit, $result) = $this->checkAndGet($key); |
| 857 | 868 | return $hit ? $result : false; |
@@ -871,6 +882,9 @@ discard block |
||
| 871 | 882 | } |
| 872 | 883 | } |
| 873 | 884 | |
| 885 | + /** |
|
| 886 | + * @param string $tag |
|
| 887 | + */ |
|
| 874 | 888 | public function clean($tag = null) { |
| 875 | 889 | if($tag) { |
| 876 | 890 | if(isset($this->tags[$tag])) { |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | * |
| 51 | 51 | * @param array|string $val String to escape, or array of strings |
| 52 | 52 | * |
| 53 | - * @return array|string |
|
| 53 | + * @return string |
|
| 54 | 54 | */ |
| 55 | 55 | public static function raw2htmlname($val) { |
| 56 | 56 | if(is_array($val)) { |
@@ -181,7 +181,7 @@ discard block |
||
| 181 | 181 | * |
| 182 | 182 | * @param string|array $identifier The identifier to escape. E.g. 'SiteTree.Title' |
| 183 | 183 | * @param string $separator The string that delimits subsequent identifiers |
| 184 | - * @return string|array The escaped identifier. E.g. '"SiteTree"."Title"' |
|
| 184 | + * @return string The escaped identifier. E.g. '"SiteTree"."Title"' |
|
| 185 | 185 | */ |
| 186 | 186 | public static function symbol2sql($identifier, $separator = '.') { |
| 187 | 187 | if(is_array($identifier)) { |
@@ -266,6 +266,7 @@ discard block |
||
| 266 | 266 | * call this function directly, Please use {@link Convert::xml2array()} |
| 267 | 267 | * |
| 268 | 268 | * @param SimpleXMLElement |
| 269 | + * @param SimpleXMLElement $xml |
|
| 269 | 270 | * |
| 270 | 271 | * @return mixed |
| 271 | 272 | */ |
@@ -234,7 +234,7 @@ discard block |
||
| 234 | 234 | * Find a File object by the given filename. |
| 235 | 235 | * |
| 236 | 236 | * @param String $filename Matched against the "Name" property. |
| 237 | - * @return mixed null if not found, File object of found file |
|
| 237 | + * @return null|DataObject null if not found, File object of found file |
|
| 238 | 238 | */ |
| 239 | 239 | public static function find($filename) { |
| 240 | 240 | // Get the base file if $filename points to a resampled file |
@@ -449,6 +449,7 @@ discard block |
||
| 449 | 449 | * showing icons on filelinks, etc. |
| 450 | 450 | * Possible group values are: "audio", "mov", "zip", "image". |
| 451 | 451 | * |
| 452 | + * @param string $ext |
|
| 452 | 453 | * @return String |
| 453 | 454 | */ |
| 454 | 455 | public static function get_app_category($ext) { |
@@ -150,6 +150,7 @@ discard block |
||
| 150 | 150 | * successfully, the manipulation's cache key is removed. |
| 151 | 151 | * |
| 152 | 152 | * @param string $filename |
| 153 | + * @param string $manipulation |
|
| 153 | 154 | * @return boolean |
| 154 | 155 | */ |
| 155 | 156 | public function failedResample($filename, $manipulation) { |
@@ -428,6 +429,10 @@ discard block |
||
| 428 | 429 | return $useAsMinimum ? $this->resizeByWidth( $maxWidth ) : $this->resizeByHeight( $maxHeight ); |
| 429 | 430 | } |
| 430 | 431 | |
| 432 | + /** |
|
| 433 | + * @param resource $image |
|
| 434 | + * @param string $webColor |
|
| 435 | + */ |
|
| 431 | 436 | public static function color_web2gd($image, $webColor, $transparencyPercent = 0) { |
| 432 | 437 | if(substr($webColor,0,1) == "#") $webColor = substr($webColor,1); |
| 433 | 438 | $r = hexdec(substr($webColor,0,2)); |
@@ -546,6 +551,9 @@ discard block |
||
| 546 | 551 | return $output; |
| 547 | 552 | } |
| 548 | 553 | |
| 554 | + /** |
|
| 555 | + * @param string $dirname |
|
| 556 | + */ |
|
| 549 | 557 | public function makeDir($dirname) { |
| 550 | 558 | if(!file_exists(dirname($dirname))) $this->makeDir(dirname($dirname)); |
| 551 | 559 | if(!file_exists($dirname)) mkdir($dirname, Config::inst()->get('Filesystem', 'folder_create_mask')); |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | * |
| 81 | 81 | * Get the backend-specific resource handling the manipulations. Replaces Image::getGD() |
| 82 | 82 | * |
| 83 | - * @return mixed |
|
| 83 | + * @return ImagickBackend |
|
| 84 | 84 | */ |
| 85 | 85 | public function getImageResource() { |
| 86 | 86 | return $this; |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | * |
| 112 | 112 | * @param int $width |
| 113 | 113 | * @param int $height |
| 114 | - * @return Image_Backend |
|
| 114 | + * @return null|ImagickBackend |
|
| 115 | 115 | */ |
| 116 | 116 | public function resize($width, $height) { |
| 117 | 117 | if(!$this->valid()) return; |
@@ -141,9 +141,9 @@ discard block |
||
| 141 | 141 | /** |
| 142 | 142 | * resizeRatio |
| 143 | 143 | * |
| 144 | - * @param int $width |
|
| 145 | - * @param int $height |
|
| 146 | - * @return Image_Backend |
|
| 144 | + * @param integer $maxWidth |
|
| 145 | + * @param integer $maxHeight |
|
| 146 | + * @return null|ImagickBackend |
|
| 147 | 147 | */ |
| 148 | 148 | public function resizeRatio($maxWidth, $maxHeight, $useAsMinimum = false) { |
| 149 | 149 | if(!$this->valid()) return; |
@@ -166,7 +166,7 @@ discard block |
||
| 166 | 166 | * resizeByWidth |
| 167 | 167 | * |
| 168 | 168 | * @param int $width |
| 169 | - * @return Image_Backend |
|
| 169 | + * @return null|ImagickBackend |
|
| 170 | 170 | */ |
| 171 | 171 | public function resizeByWidth($width) { |
| 172 | 172 | if(!$this->valid()) return; |
@@ -183,7 +183,7 @@ discard block |
||
| 183 | 183 | * resizeByHeight |
| 184 | 184 | * |
| 185 | 185 | * @param int $height |
| 186 | - * @return Image_Backend |
|
| 186 | + * @return null|ImagickBackend |
|
| 187 | 187 | */ |
| 188 | 188 | public function resizeByHeight($height) { |
| 189 | 189 | if(!$this->valid()) return; |
@@ -202,7 +202,7 @@ discard block |
||
| 202 | 202 | * @param int $width |
| 203 | 203 | * @param int $height |
| 204 | 204 | * @param int $transparencyPercent |
| 205 | - * @return Image_Backend |
|
| 205 | + * @return null|ImagickBackend |
|
| 206 | 206 | */ |
| 207 | 207 | public function paddedResize($width, $height, $backgroundColor = "FFFFFF", $transparencyPercent = 0) { |
| 208 | 208 | $width = intval($width); |
@@ -227,7 +227,7 @@ discard block |
||
| 227 | 227 | /** |
| 228 | 228 | * Convert a percentage (or 'true') to a two char hex code to signifiy the level of an alpha channel |
| 229 | 229 | * |
| 230 | - * @param $percent |
|
| 230 | + * @param integer $percent |
|
| 231 | 231 | * @return string |
| 232 | 232 | */ |
| 233 | 233 | public function calculateAlphaHex($percent) { |
@@ -248,7 +248,7 @@ discard block |
||
| 248 | 248 | * |
| 249 | 249 | * @param int $width |
| 250 | 250 | * @param int $height |
| 251 | - * @return Image_Backend |
|
| 251 | + * @return null|ImagickBackend |
|
| 252 | 252 | */ |
| 253 | 253 | public function croppedResize($width, $height) { |
| 254 | 254 | if(!$this->valid()) return; |
@@ -56,6 +56,10 @@ discard block |
||
| 56 | 56 | */ |
| 57 | 57 | protected $config; |
| 58 | 58 | |
| 59 | + /** |
|
| 60 | + * @param string $name |
|
| 61 | + * @param string $title |
|
| 62 | + */ |
|
| 59 | 63 | public function __construct($name, $title = null, $value = ""){ |
| 60 | 64 | $this->config = $this->config()->default_config; |
| 61 | 65 | |
@@ -68,6 +72,9 @@ discard block |
||
| 68 | 72 | parent::__construct($name, $title, $value); |
| 69 | 73 | } |
| 70 | 74 | |
| 75 | + /** |
|
| 76 | + * @param Form $form |
|
| 77 | + */ |
|
| 71 | 78 | public function setForm($form) { |
| 72 | 79 | parent::setForm($form); |
| 73 | 80 | |
@@ -78,6 +85,9 @@ discard block |
||
| 78 | 85 | return $this; |
| 79 | 86 | } |
| 80 | 87 | |
| 88 | + /** |
|
| 89 | + * @param string $name |
|
| 90 | + */ |
|
| 81 | 91 | public function setName($name) { |
| 82 | 92 | parent::setName($name); |
| 83 | 93 | |
@@ -90,7 +100,7 @@ discard block |
||
| 90 | 100 | |
| 91 | 101 | /** |
| 92 | 102 | * @param array $properties |
| 93 | - * @return HTMLText |
|
| 103 | + * @return string |
|
| 94 | 104 | */ |
| 95 | 105 | public function FieldHolder($properties = array()) { |
| 96 | 106 | $config = array( |
@@ -105,7 +115,7 @@ discard block |
||
| 105 | 115 | |
| 106 | 116 | /** |
| 107 | 117 | * @param array $properties |
| 108 | - * @return HTMLText |
|
| 118 | + * @return string |
|
| 109 | 119 | */ |
| 110 | 120 | public function Field($properties = array()) { |
| 111 | 121 | Requirements::css(FRAMEWORK_DIR . '/css/DatetimeField.css'); |
@@ -234,6 +244,7 @@ discard block |
||
| 234 | 244 | |
| 235 | 245 | /** |
| 236 | 246 | * @param FormField |
| 247 | + * @param DateField $field |
|
| 237 | 248 | */ |
| 238 | 249 | public function setDateField($field) { |
| 239 | 250 | $expected = $this->getName() . '[date]'; |
@@ -259,6 +270,7 @@ discard block |
||
| 259 | 270 | |
| 260 | 271 | /** |
| 261 | 272 | * @param FormField |
| 273 | + * @param TimeField $field |
|
| 262 | 274 | */ |
| 263 | 275 | public function setTimeField($field) { |
| 264 | 276 | $expected = $this->getName() . '[time]'; |
@@ -297,7 +309,7 @@ discard block |
||
| 297 | 309 | * to set field-specific config options. |
| 298 | 310 | * |
| 299 | 311 | * @param string $name |
| 300 | - * @param mixed $val |
|
| 312 | + * @param string $val |
|
| 301 | 313 | */ |
| 302 | 314 | public function setConfig($name, $val) { |
| 303 | 315 | $this->config[$name] = $val; |
@@ -315,7 +327,7 @@ discard block |
||
| 315 | 327 | * to get field-specific config options. |
| 316 | 328 | * |
| 317 | 329 | * @param String $name Optional, returns the whole configuration array if empty |
| 318 | - * @return mixed |
|
| 330 | + * @return string|null |
|
| 319 | 331 | */ |
| 320 | 332 | public function getConfig($name = null) { |
| 321 | 333 | if($name) { |
@@ -325,6 +337,9 @@ discard block |
||
| 325 | 337 | } |
| 326 | 338 | } |
| 327 | 339 | |
| 340 | + /** |
|
| 341 | + * @param RequiredFields $validator |
|
| 342 | + */ |
|
| 328 | 343 | public function validate($validator) { |
| 329 | 344 | $dateValid = $this->dateField->validate($validator); |
| 330 | 345 | $timeValid = $this->timeField->validate($validator); |
@@ -50,6 +50,7 @@ discard block |
||
| 50 | 50 | * |
| 51 | 51 | * By default, this is set to true so that it's clearer what's happening, but the predefined |
| 52 | 52 | * {@link GridFieldConfig} subclasses set this to false for flexibility. |
| 53 | + * @param boolean $throwExceptionOnBadDataType |
|
| 53 | 54 | */ |
| 54 | 55 | public function setThrowExceptionOnBadDataType($throwExceptionOnBadDataType) { |
| 55 | 56 | $this->throwExceptionOnBadDataType = $throwExceptionOnBadDataType; |
@@ -65,6 +66,7 @@ discard block |
||
| 65 | 66 | /** |
| 66 | 67 | * Check that this dataList is of the right data type. |
| 67 | 68 | * Returns false if it's a bad data type, and if appropriate, throws an exception. |
| 69 | + * @param SS_List $dataList |
|
| 68 | 70 | */ |
| 69 | 71 | protected function checkDataType($dataList) { |
| 70 | 72 | if($dataList instanceof SS_Limitable) { |
@@ -271,6 +273,7 @@ discard block |
||
| 271 | 273 | |
| 272 | 274 | /** |
| 273 | 275 | * @param Int |
| 276 | + * @param integer $num |
|
| 274 | 277 | */ |
| 275 | 278 | public function setItemsPerPage($num) { |
| 276 | 279 | $this->itemsPerPage = $num; |
@@ -765,7 +765,7 @@ discard block |
||
| 765 | 765 | * Extend permissions to include additional security for objects that are not published to live. |
| 766 | 766 | * |
| 767 | 767 | * @param Member $member |
| 768 | - * @return bool|null |
|
| 768 | + * @return false|null |
|
| 769 | 769 | */ |
| 770 | 770 | public function canView($member = null) { |
| 771 | 771 | // Invoke default version-gnostic canView |
@@ -839,7 +839,7 @@ discard block |
||
| 839 | 839 | * |
| 840 | 840 | * @param string $stage |
| 841 | 841 | * @param Member $member |
| 842 | - * @return bool |
|
| 842 | + * @return boolean|string |
|
| 843 | 843 | */ |
| 844 | 844 | public function canViewStage($stage = 'Live', $member = null) { |
| 845 | 845 | $oldMode = Versioned::get_reading_mode(); |
@@ -905,7 +905,7 @@ discard block |
||
| 905 | 905 | /** |
| 906 | 906 | * Is the latest version of the object published? |
| 907 | 907 | * |
| 908 | - * @return bool |
|
| 908 | + * @return string |
|
| 909 | 909 | */ |
| 910 | 910 | public function latestPublished() { |
| 911 | 911 | // Get the root data object class - this will have the version field |
@@ -1029,7 +1029,7 @@ discard block |
||
| 1029 | 1029 | * @param string $limit |
| 1030 | 1030 | * @param string $join Deprecated, use leftJoin($table, $joinClause) instead |
| 1031 | 1031 | * @param string $having |
| 1032 | - * @return DataList |
|
| 1032 | + * @return ArrayList |
|
| 1033 | 1033 | */ |
| 1034 | 1034 | public function Versions($filter = "", $sort = "", $limit = "", $join = "", $having = "") { |
| 1035 | 1035 | return $this->allVersions($filter, $sort, $limit, $join, $having); |
@@ -1043,7 +1043,7 @@ discard block |
||
| 1043 | 1043 | * @param string $limit |
| 1044 | 1044 | * @param string $join Deprecated, use leftJoin($table, $joinClause) instead |
| 1045 | 1045 | * @param string $having |
| 1046 | - * @return DataList |
|
| 1046 | + * @return ArrayList |
|
| 1047 | 1047 | */ |
| 1048 | 1048 | public function allVersions($filter = "", $sort = "", $limit = "", $join = "", $having = "") { |
| 1049 | 1049 | // Make sure the table names are not postfixed (e.g. _Live) |
@@ -1361,7 +1361,7 @@ discard block |
||
| 1361 | 1361 | * @param string $filter A filter to be inserted into the WHERE clause. |
| 1362 | 1362 | * @param string $sort A sort expression to be inserted into the ORDER BY clause. |
| 1363 | 1363 | * @param string $join Deprecated, use leftJoin($table, $joinClause) instead |
| 1364 | - * @param string|int $limit A limit on the number of records returned from the database. |
|
| 1364 | + * @param integer $limit A limit on the number of records returned from the database. |
|
| 1365 | 1365 | * @param string $containerClass The container class for the result set (default is DataList) |
| 1366 | 1366 | * |
| 1367 | 1367 | * @return DataList A modified DataList designated to the specified stage |