Skip to content

Commit

Permalink
CDataProvider fix - issue #1546
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryadnov committed Oct 8, 2012
1 parent 7cc307d commit 83f9bc6
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions framework/web/CDataProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 83f9bc6

Please sign in to comment.