Skip to content

Commit

Permalink
Merge pull request #205 from ThaDafinser/hotfix/array
Browse files Browse the repository at this point in the history
fixing toArray #191 #203
  • Loading branch information
ThaDafinser committed Aug 31, 2015
2 parents 2a584cf + 12c7852 commit 6462985
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/ZfcDatagrid/Column/Action/AbstractAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ public function isDisplayed(array $row)
if (isset($row[$rule['column']->getUniqueId()])) {
$value = $row[$rule['column']->getUniqueId()];
}

if ($rule['value'] instanceof AbstractColumn) {
if (isset($row[$rule['value']->getUniqueId()])) {
$ruleValue = $row[$rule['value']->getUniqueId()];
Expand Down
4 changes: 3 additions & 1 deletion src/ZfcDatagrid/PrepareData.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@ public function prepare()
$data = $this->data;

foreach ($data as $key => &$row) {
$row = (array) $row;

$ids = [];

foreach ($this->getColumns() as $col) {
Expand Down Expand Up @@ -224,7 +226,7 @@ public function prepare()
*/
if ($col->hasFormatters() === true) {
foreach ($col->getFormatters() as $formatter) {
$formatter->setRowData((array) $row);
$formatter->setRowData($row);
$formatter->setRendererName($this->getRendererName());

$row[$col->getUniqueId()] = $formatter->format($col);
Expand Down
6 changes: 3 additions & 3 deletions tests/ZfcDatagridTest/Column/Action/AbstractActionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ public function testIsDisplayedException()
$this->column->getUniqueId() => '32',
]);
}

public function testIsDisplayedByColumn()
{
/* @var $action \ZfcDatagrid\Column\Action\AbstractAction */
Expand All @@ -238,8 +238,8 @@ public function testIsDisplayedByColumn()
$action->addShowOnValue($this->column, $columnCompare, Filter::GREATER_EQUAL);
$this->assertEquals([
[
'column' => $this->column,
'value' => $columnCompare,
'column' => $this->column,
'value' => $columnCompare,
'comparison' => Filter::GREATER_EQUAL,
],
], $action->getShowOnValues());
Expand Down

0 comments on commit 6462985

Please sign in to comment.