@@ -38,6 +38,7 @@ discard block |
||
| 38 | 38 | |
| 39 | 39 | /** |
| 40 | 40 | * @todo Move this to SS_Database or DB |
| 41 | + * @param string $class |
|
| 41 | 42 | */ |
| 42 | 43 | public static function hasTable($class) { |
| 43 | 44 | // Cache the list of all table names to reduce on DB traffic |
@@ -219,6 +220,7 @@ discard block |
||
| 219 | 220 | |
| 220 | 221 | /** |
| 221 | 222 | * Returns true if the given class implements the given interface |
| 223 | + * @param string $interfaceName |
|
| 222 | 224 | */ |
| 223 | 225 | public static function classImplements($className, $interfaceName) { |
| 224 | 226 | return in_array($className, self::implementorsOf($interfaceName)); |
@@ -269,6 +271,9 @@ discard block |
||
| 269 | 271 | |
| 270 | 272 | private static $method_from_cache = array(); |
| 271 | 273 | |
| 274 | + /** |
|
| 275 | + * @param string $method |
|
| 276 | + */ |
|
| 272 | 277 | public static function has_method_from($class, $method, $compclass) { |
| 273 | 278 | $lClass = strtolower($class); |
| 274 | 279 | $lMethod = strtolower($method); |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | * Returns a new DataList instance with the specified query parameter assigned |
| 158 | 158 | * |
| 159 | 159 | * @param string|array $keyOrArray Either the single key to set, or an array of key value pairs to set |
| 160 | - * @param mixed $val If $keyOrArray is not an array, this is the value to set |
|
| 160 | + * @param string $val If $keyOrArray is not an array, this is the value to set |
|
| 161 | 161 | * @return DataList |
| 162 | 162 | */ |
| 163 | 163 | public function setDataQueryParam($keyOrArray, $val = null) { |
@@ -520,7 +520,7 @@ discard block |
||
| 520 | 520 | * Check if the given field specification could be interpreted as an unquoted relation name |
| 521 | 521 | * |
| 522 | 522 | * @param string $field |
| 523 | - * @return bool |
|
| 523 | + * @return integer |
|
| 524 | 524 | */ |
| 525 | 525 | protected function isValidRelationName($field) { |
| 526 | 526 | return preg_match('/^[A-Z0-9._]+$/i', $field); |
@@ -635,7 +635,7 @@ discard block |
||
| 635 | 635 | * @param int $order A numerical index to control the order that joins are added to the query; lower order values |
| 636 | 636 | * will cause the query to appear first. The default is 20, and joins created automatically by the |
| 637 | 637 | * ORM have a value of 10. |
| 638 | - * @param array $parameters Any additional parameters if the join is a parameterised subquery |
|
| 638 | + * @param string[] $parameters Any additional parameters if the join is a parameterised subquery |
|
| 639 | 639 | * @return DataList |
| 640 | 640 | */ |
| 641 | 641 | public function innerJoin($table, $onClause, $alias = null, $order = 20, $parameters = array()) { |
@@ -653,7 +653,7 @@ discard block |
||
| 653 | 653 | * @param int $order A numerical index to control the order that joins are added to the query; lower order values |
| 654 | 654 | * will cause the query to appear first. The default is 20, and joins created automatically by the |
| 655 | 655 | * ORM have a value of 10. |
| 656 | - * @param array $parameters Any additional parameters if the join is a parameterised subquery |
|
| 656 | + * @param string[] $parameters Any additional parameters if the join is a parameterised subquery |
|
| 657 | 657 | * @return DataList |
| 658 | 658 | */ |
| 659 | 659 | public function leftJoin($table, $onClause, $alias = null, $order = 20, $parameters = array()) { |
@@ -780,7 +780,7 @@ discard block |
||
| 780 | 780 | * Return the maximum value of the given field in this DataList |
| 781 | 781 | * |
| 782 | 782 | * @param string $fieldName |
| 783 | - * @return mixed |
|
| 783 | + * @return string |
|
| 784 | 784 | */ |
| 785 | 785 | public function max($fieldName) { |
| 786 | 786 | return $this->dataQuery->max($fieldName); |
@@ -790,7 +790,7 @@ discard block |
||
| 790 | 790 | * Return the minimum value of the given field in this DataList |
| 791 | 791 | * |
| 792 | 792 | * @param string $fieldName |
| 793 | - * @return mixed |
|
| 793 | + * @return string |
|
| 794 | 794 | */ |
| 795 | 795 | public function min($fieldName) { |
| 796 | 796 | return $this->dataQuery->min($fieldName); |
@@ -800,7 +800,7 @@ discard block |
||
| 800 | 800 | * Return the average value of the given field in this DataList |
| 801 | 801 | * |
| 802 | 802 | * @param string $fieldName |
| 803 | - * @return mixed |
|
| 803 | + * @return string |
|
| 804 | 804 | */ |
| 805 | 805 | public function avg($fieldName) { |
| 806 | 806 | return $this->dataQuery->avg($fieldName); |
@@ -810,7 +810,7 @@ discard block |
||
| 810 | 810 | * Return the sum of the values of the given field in this DataList |
| 811 | 811 | * |
| 812 | 812 | * @param string $fieldName |
| 813 | - * @return mixed |
|
| 813 | + * @return string |
|
| 814 | 814 | */ |
| 815 | 815 | public function sum($fieldName) { |
| 816 | 816 | return $this->dataQuery->sum($fieldName); |
@@ -862,7 +862,7 @@ discard block |
||
| 862 | 862 | /** |
| 863 | 863 | * Restrict the columns to fetch into this DataList |
| 864 | 864 | * |
| 865 | - * @param array $queriedColumns |
|
| 865 | + * @param string[] $queriedColumns |
|
| 866 | 866 | * @return DataList |
| 867 | 867 | */ |
| 868 | 868 | public function setQueriedColumns($queriedColumns) { |
@@ -1135,7 +1135,7 @@ discard block |
||
| 1135 | 1135 | /** |
| 1136 | 1136 | * Returns item stored in list with index $key |
| 1137 | 1137 | * |
| 1138 | - * @param mixed $key |
|
| 1138 | + * @param integer $key |
|
| 1139 | 1139 | * @return DataObject |
| 1140 | 1140 | */ |
| 1141 | 1141 | public function offsetGet($key) { |
@@ -166,7 +166,7 @@ discard block |
||
| 166 | 166 | /** |
| 167 | 167 | * Ensure that the query is ready to execute. |
| 168 | 168 | * |
| 169 | - * @param array|null $queriedColumns Any columns to filter the query by |
|
| 169 | + * @param string[] $queriedColumns Any columns to filter the query by |
|
| 170 | 170 | * @return SQLSelect The finalised sql query |
| 171 | 171 | */ |
| 172 | 172 | public function getFinalisedQuery($queriedColumns = null) { |
@@ -641,10 +641,10 @@ discard block |
||
| 641 | 641 | * mappings to the query object state. This has to be called |
| 642 | 642 | * in any overloaded {@link SearchFilter->apply()} methods manually. |
| 643 | 643 | * |
| 644 | - * @param String|array $relation The array/dot-syntax relation to follow |
|
| 644 | + * @param string $relation The array/dot-syntax relation to follow |
|
| 645 | 645 | * @param bool $linearOnly Set to true to restrict to linear relations only. Set this |
| 646 | 646 | * if this relation will be used for sorting, and should not include duplicate rows. |
| 647 | - * @return The model class of the related item |
|
| 647 | + * @return string model class of the related item |
|
| 648 | 648 | */ |
| 649 | 649 | public function applyRelation($relation, $linearOnly = false) { |
| 650 | 650 | // NO-OP |
@@ -917,6 +917,7 @@ discard block |
||
| 917 | 917 | |
| 918 | 918 | /** |
| 919 | 919 | * Set an arbitrary query parameter, that can be used by decorators to add additional meta-data to the query. |
| 920 | + * @param string $key |
|
| 920 | 921 | */ |
| 921 | 922 | public function getQueryParam($key) { |
| 922 | 923 | if(isset($this->queryParams[$key])) return $this->queryParams[$key]; |
@@ -949,6 +950,9 @@ discard block |
||
| 949 | 950 | */ |
| 950 | 951 | protected $whereQuery; |
| 951 | 952 | |
| 953 | + /** |
|
| 954 | + * @param string $connective |
|
| 955 | + */ |
|
| 952 | 956 | public function __construct(DataQuery $base, $connective) { |
| 953 | 957 | $this->dataClass = $base->dataClass; |
| 954 | 958 | $this->query = $base->query; |
@@ -958,6 +962,9 @@ discard block |
||
| 958 | 962 | $base->where($this); |
| 959 | 963 | } |
| 960 | 964 | |
| 965 | + /** |
|
| 966 | + * @param string $filter |
|
| 967 | + */ |
|
| 961 | 968 | public function where($filter) { |
| 962 | 969 | if($filter) { |
| 963 | 970 | $this->whereQuery->addWhere($filter); |
@@ -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}"; |
@@ -647,15 +653,6 @@ discard block |
||
| 647 | 653 | * |
| 648 | 654 | * @param string $class The class to remove a configuration value from |
| 649 | 655 | * @param string $name The configuration name |
| 650 | - * @param mixed $key An optional key to filter against. |
|
| 651 | - * If referenced config value is an array, only members of that array that match this key will be removed |
|
| 652 | - * Must also match value if provided to be removed |
|
| 653 | - * @param mixed $value And optional value to filter against. |
|
| 654 | - * If referenced config value is an array, only members of that array that match this value will be removed |
|
| 655 | - * If referenced config value is not an array, value will be removed only if it matches this argument |
|
| 656 | - * Must also match key if provided and referenced config value is an array to be removed |
|
| 657 | - * |
|
| 658 | - * Matching is always by "==", not by "===" |
|
| 659 | 656 | */ |
| 660 | 657 | public function remove($class, $name /*,$key = null*/ /*,$value = null*/) { |
| 661 | 658 | $argc = func_num_args(); |
@@ -734,6 +731,10 @@ discard block |
||
| 734 | 731 | $this->cache = $cloned; |
| 735 | 732 | } |
| 736 | 733 | |
| 734 | + /** |
|
| 735 | + * @param integer $key |
|
| 736 | + * @param integer $val |
|
| 737 | + */ |
|
| 737 | 738 | public function set($key, $val, $tags = array()) { |
| 738 | 739 | // Find an index to set at |
| 739 | 740 | $replacing = null; |
@@ -769,6 +770,9 @@ discard block |
||
| 769 | 770 | return $this->miss ? ($this->hit / $this->miss) : 0; |
| 770 | 771 | } |
| 771 | 772 | |
| 773 | + /** |
|
| 774 | + * @param integer $key |
|
| 775 | + */ |
|
| 772 | 776 | public function get($key) { |
| 773 | 777 | if (isset($this->indexing[$key])) { |
| 774 | 778 | $this->hit++; |
@@ -782,6 +786,9 @@ discard block |
||
| 782 | 786 | return false; |
| 783 | 787 | } |
| 784 | 788 | |
| 789 | + /** |
|
| 790 | + * @param string $tag |
|
| 791 | + */ |
|
| 785 | 792 | public function clean($tag = null) { |
| 786 | 793 | if ($tag) { |
| 787 | 794 | foreach ($this->cache as $i => $v) { |
@@ -938,7 +945,7 @@ discard block |
||
| 938 | 945 | * |
| 939 | 946 | * @param string $key |
| 940 | 947 | * |
| 941 | - * @return bool |
|
| 948 | + * @return boolean|null |
|
| 942 | 949 | */ |
| 943 | 950 | protected function disablePersistentCache($key) { |
| 944 | 951 | $this->disabledPersistentCache[$key] = true; |
@@ -732,6 +732,9 @@ discard block |
||
| 732 | 732 | return $result; |
| 733 | 733 | } |
| 734 | 734 | |
| 735 | + /** |
|
| 736 | + * @param string $mode |
|
| 737 | + */ |
|
| 735 | 738 | protected function _get($dir, $mode, $tags = array()) |
| 736 | 739 | { |
| 737 | 740 | if (!is_dir($dir)) { |
@@ -819,6 +822,7 @@ discard block |
||
| 819 | 822 | /** |
| 820 | 823 | * Compute & return the expire time |
| 821 | 824 | * |
| 825 | + * @param integer $lifetime |
|
| 822 | 826 | * @return int expire time (unix timestamp) |
| 823 | 827 | */ |
| 824 | 828 | protected function _expireTime($lifetime) |