/** * Renders an aggregate row for given aggregate row configuration and given row index * * @param Tx_PtExtlist_Domain_Model_List_Row $aggregateDataRow Row to be rendered * @param Tx_PtExtlist_Domain_Configuration_Aggregates_AggregateRowConfig $aggregateRowConfig Config used to render aggregate row * @param integer $rowIndex Index of rendered row * @return Tx_PtExtlist_Domain_Model_List_ListData Rendered aggregate row */ public function renderAggregateRow(Tx_PtExtlist_Domain_Model_List_Row $aggregateDataRow, Tx_PtExtlist_Domain_Configuration_Aggregates_AggregateRowConfig $aggregateRowConfig, $rowIndex) { $renderedRow = new Tx_PtExtlist_Domain_Model_List_Row(); $columnCollection = $this->getColumnCollection(); foreach ($columnCollection as $columnIdentifier => $column) { /* @var $column Tx_PtExtlist_Domain_Model_List_Header_HeaderColumn */ $columnConfiguration = $column->getColumnConfig(); if ($columnConfiguration->isAccessable() && $column->getIsVisible()) { if ($aggregateRowConfig->hasItem($columnConfiguration->getColumnIdentifier())) { $cell = $this->renderCell($aggregateRowConfig->getItemById($columnConfiguration->getColumnIdentifier()), $aggregateDataRow, $columnIdentifier, $rowIndex); } else { $cell = new Tx_PtExtlist_Domain_Model_List_Cell(); } $renderedRow->addCell($cell, $columnIdentifier); } } unset($aggregateDataRow); return $renderedRow; }
/** * @param array $rowData * @return Tx_PtExtlist_Domain_Model_List_Row */ protected function createRowFromTestData(array $rowData) { $row = new Tx_PtExtlist_Domain_Model_List_Row(); $row->setSpecialValues($rowData['specialValues']); foreach ($rowData['columns'] as $key => $testCell) { $cell = new Tx_PtExtlist_Domain_Model_List_Cell($testCell['value']); $cell->setCSSClass($testCell['cssClass']); $cell->setColumnIndex($testCell['columnIndex']); $cell->setRowIndex($testCell['rowIndex']); $cell->addSpecialValue('key1', $testCell['specialValues']['key1']); $row->addCell($cell, $key); } return $row; }