Permalink
Browse files

API CHANGE DataObject::getComponents() should use default value for l…

…imit as NULL
  • Loading branch information...
1 parent 426f167 commit 2cb67efe074263253baefa204c77896ad7d9aec7 @stojg stojg committed Mar 9, 2012
Showing with 5 additions and 2 deletions.
  1. +4 −1 model/DataList.php
  2. +1 −1 model/DataObject.php
View
@@ -146,7 +146,10 @@ public function join($join) {
* @param string $limit
*/
public function limit($limit, $offset = 0) {
- if(!is_numeric($limit)) {
+ if(!$limit && !$offset) {
+ return $this;
+ }
+ if($limit && !is_numeric($limit)) {
Deprecation::notice('3.0', 'Please pass limits as 2 arguments, rather than an array or SQL fragment.');
}
$this->dataQuery->limit($limit, $offset);
View
@@ -1309,7 +1309,7 @@ public function getComponent($componentName) {
*
* @return HasManyList The components of the one-to-many relationship.
*/
- public function getComponents($componentName, $filter = "", $sort = "", $join = "", $limit = "") {
+ public function getComponents($componentName, $filter = "", $sort = "", $join = "", $limit = null) {
$result = null;
if(!$componentClass = $this->has_many($componentName)) {

0 comments on commit 2cb67ef

Please sign in to comment.