mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
API CHANGE DataObject::getComponents() should use default value for limit as NULL
This commit is contained in:
parent
426f16764c
commit
2cb67efe07
@ -146,7 +146,10 @@ class DataList extends ViewableData implements SS_List, SS_Filterable, SS_Sortab
|
|||||||
* @param string $limit
|
* @param string $limit
|
||||||
*/
|
*/
|
||||||
public function limit($limit, $offset = 0) {
|
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.');
|
Deprecation::notice('3.0', 'Please pass limits as 2 arguments, rather than an array or SQL fragment.');
|
||||||
}
|
}
|
||||||
$this->dataQuery->limit($limit, $offset);
|
$this->dataQuery->limit($limit, $offset);
|
||||||
|
@ -1309,7 +1309,7 @@ class DataObject extends ViewableData implements DataObjectInterface, i18nEntity
|
|||||||
*
|
*
|
||||||
* @return HasManyList The components of the one-to-many relationship.
|
* @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;
|
$result = null;
|
||||||
|
|
||||||
if(!$componentClass = $this->has_many($componentName)) {
|
if(!$componentClass = $this->has_many($componentName)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user