Skip to content

Commit

Permalink
use selectParts instead of uniqueId in array
Browse files Browse the repository at this point in the history
  • Loading branch information
ThaDafinser committed Sep 1, 2015
1 parent d98f053 commit 2cad7f3
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/ZfcDatagrid/DataSource/PhpArray.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
namespace ZfcDatagrid\DataSource;

use Zend\Paginator\Adapter\ArrayAdapter as PaginatorAdapter;
use ZfcDatagrid\Column;

class PhpArray extends AbstractDataSource
{
Expand Down Expand Up @@ -68,8 +69,17 @@ public function execute()
* @todo ? Better performance or let it be?
*/
$selectedColumns = [];
foreach ($this->getColumns() as $column) {
$selectedColumns[] = $column->getUniqueId();
foreach ($this->getColumns() as $col) {
if (!$col instanceof Column\Select) {
continue;
}

$colString = $col->getSelectPart1();
if ($col->getSelectPart2() != '') {
$colString = $col->getSelectPart1() . '_' . $col->getSelectPart2();
}

$selectedColumns[] = $colString;
}

foreach ($data as &$row) {
Expand Down

0 comments on commit 2cad7f3

Please sign in to comment.