Permalink
Browse files

Bad parameter forwarding from SS_ListDecorator (sort,filter,exclude) …

…to i.e. DataList.
  • Loading branch information...
1 parent 3a9ea42 commit 09c1f8f576ad8bf1a76022b35a4d08b974b66a23 @beerbohmdo beerbohmdo committed Jan 16, 2012
Showing with 9 additions and 10 deletions.
  1. +9 −10 model/ListDecorator.php
@@ -1,7 +1,7 @@
<?php
/**
* A base class for decorators that wrap around a list to provide additional
- * functionality. It passes through list methods to the underlying list
+ * functionality. It passes through list methods to the underlying list
* implementation.
*
* @package sapphire
@@ -108,7 +108,7 @@ public function column($value = 'ID') {
public function canSortBy($by) {
return $this->list->canSortBy($by);
}
-
+
/**
* Sorts this list by one or more fields. You can either pass in a single
* field name and direction, or a map of field names to sort directions.
@@ -120,22 +120,22 @@ public function canSortBy($by) {
*/
public function sort() {
$args = func_get_args();
- return $this->list->sort($args);
+ return call_user_func_array(array($this->list, 'sort'), $args);
}
-
+
/**
* Filter the list to include items with these charactaristics
- *
+ *
* @example $list->filter('Name', 'bob'); // only bob in list
* @example $list->filter('Name', array('aziz', 'bob'); // aziz and bob in list
* @example $list->filter(array('Name'=>'bob, 'Age'=>21)); // bob or someone with Age 21
- * @example $list->filter(array('Name'=>'bob, 'Age'=>array(21, 43))); // bob or anyone with Age 21 or 43
+ * @example $list->filter(array('Name'=>'bob, 'Age'=>array(21, 43))); // bob or anyone with Age 21 or 43
*/
public function filter(){
$args = func_get_args();
- return $this->list->filter(func_get_args($args));
+ return call_user_func_array(array($this->list, 'filter'), $args);
}
-
+
/**
* Exclude the list to not contain items with these charactaristics
*
@@ -146,8 +146,7 @@ public function filter(){
*/
public function exclude(){
$args = func_get_args();
- return $this->list->exclude(func_get_args($args));
-
+ return call_user_func_array(array($this->list, 'exclude'), $args);
}
public function debug() {

0 comments on commit 09c1f8f

Please sign in to comment.