/**
  * @param Tx_PtExtlist_Domain_Configuration_ConfigurationBuilder $configurationBuilder
  * @param array $aggregateRowSettings
  * @return Tx_PtExtlist_Domain_Configuration_Columns_ColumnConfigCollection
  */
 protected static function buildAggregateRowConfigObject(Tx_PtExtlist_Domain_Configuration_ConfigurationBuilder $configurationBuilder, array $aggregateRowSettings)
 {
     $aggregateRowConfig = new Tx_PtExtlist_Domain_Configuration_Aggregates_AggregateRowConfig();
     foreach ($aggregateRowSettings as $columnIdentifier => $aggregateColumnSettings) {
         $aggregateColumnConfig = new Tx_PtExtlist_Domain_Configuration_Aggregates_AggregateColumnConfig($configurationBuilder, $aggregateColumnSettings, $columnIdentifier);
         $aggregateRowConfig->addAggregateColumnConfig($aggregateColumnConfig, $columnIdentifier);
     }
     return $aggregateRowConfig;
 }
Esempio n. 2
0
 /**
  * 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;
 }