/** * Build the aggregate data by configuration * * @return Tx_PtExtlist_Domain_Model_List_Row */ protected function buildAggregateDataRow() { $dataRow = new Tx_PtExtlist_Domain_Model_List_Row(); $aggregateDataConfigCollection = $this->configurationBuilder->buildAggregateDataConfig(); $aggregatesForPage = $this->getAggregatesForPage($aggregateDataConfigCollection->extractCollectionByScope('page')); $aggregatesForQuery = $this->getAggregatesForQuery($aggregateDataConfigCollection->extractCollectionByScope('query')); \TYPO3\CMS\Core\Utility\ArrayUtility::mergeRecursiveWithOverrule($aggregatesForQuery, $aggregatesForPage); foreach ($aggregatesForQuery as $key => $value) { $dataRow->createAndAddCell($value, $key); } return $dataRow; }
public function testBuildAggregateDataConfiguration() { $configurationBuilder = new Tx_PtExtlist_Domain_Configuration_ConfigurationBuilder($this->settings, 'test'); $aggregateDataConfigCollection = $configurationBuilder->buildAggregateDataConfig(); $this->assertTrue(is_a($aggregateDataConfigCollection, 'Tx_PtExtlist_Domain_Configuration_Data_Aggregates_AggregateConfigCollection')); }
/** * Build the aggregate list data if any aggregates are defined * * @param Tx_PtExtlist_Domain_DataBackend_DataBackendInterface $dataBackend * @param Tx_PtExtlist_Domain_Configuration_ConfigurationBuilder $configurationBuilder * @return Tx_PtExtlist_Domain_Model_List_ListData */ public function buildAggregateListData(Tx_PtExtlist_Domain_DataBackend_DataBackendInterface $dataBackend, Tx_PtExtlist_Domain_Configuration_ConfigurationBuilder $configurationBuilder) { if ($configurationBuilder->buildAggregateDataConfig()->count() > 0) { return $dataBackend->getAggregateListData(); } else { return new Tx_PtExtlist_Domain_Model_List_ListData(); } }