Permalink
Browse files

CDataProvider fix - issue #1546

  • Loading branch information...
1 parent 7cc307d commit 83f9bc630c83255db1d4bc962a24dd8c32989da4 @Ryadnov Ryadnov committed Oct 8, 2012
Showing with 16 additions and 2 deletions.
  1. +16 −2 framework/web/CDataProvider.php
@@ -94,7 +94,14 @@ public function setPagination($value)
{
if(is_array($value))
{
- $pagination=isset($value['class']) ? $this->getPagination($value['class']) : $this->getPagination();
+ if(isset($value['class']))
+ {
+ $pagination=$this->getPagination($value['class']);
+ unset($value['class']);
+ }
+ else
+ $pagination=$this->getPagination();
+
foreach($value as $k=>$v)
$pagination->$k=$v;
}
@@ -135,7 +142,14 @@ public function setSort($value)
{
if(is_array($value))
{
- $sort=isset($value['class']) ? $this->getSort($value['class']) : $this->getSort();
+ if(isset($value['class']))
+ {
+ $sort=$this->getSort($value['class']);
+ unset($value['class']);
+ }
+ else
+ $sort=$this->getSort();
+
foreach($value as $k=>$v)
$sort->$k=$v;
}

0 comments on commit 83f9bc6

Please sign in to comment.