From 2cad7f32fc1ca193c5ec55e95fe49dfec00a5cd3 Mon Sep 17 00:00:00 2001 From: ThaDafinser Date: Tue, 1 Sep 2015 15:02:39 +0200 Subject: [PATCH] use selectParts instead of uniqueId in array --- src/ZfcDatagrid/DataSource/PhpArray.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/ZfcDatagrid/DataSource/PhpArray.php b/src/ZfcDatagrid/DataSource/PhpArray.php index 17817ae1..dde005d6 100644 --- a/src/ZfcDatagrid/DataSource/PhpArray.php +++ b/src/ZfcDatagrid/DataSource/PhpArray.php @@ -2,6 +2,7 @@ namespace ZfcDatagrid\DataSource; use Zend\Paginator\Adapter\ArrayAdapter as PaginatorAdapter; +use ZfcDatagrid\Column; class PhpArray extends AbstractDataSource { @@ -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) {