2 namespace TYPO3\CMS\Workspaces\Service;
32 return self::getObjectManager()->get(\TYPO3\CMS\Workspaces\Service\AdditionalColumnService::class);
40 return \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Extbase\Object\ObjectManager::class);
51 public function register($columnName, $dataProviderClassOrObject)
53 if (is_object($dataProviderClassOrObject)) {
54 $dataProvider = $dataProviderClassOrObject;
56 $dataProvider = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance($dataProviderClassOrObject);
60 throw new \RuntimeException(
'Data provider needs to implement ColumnDataProviderInterface', 1374309323);
63 $this->columns[$columnName] = $dataProvider;
73 $columnSettings = array();
74 foreach ($this->columns as $columnName => $dataProvider) {
75 $definition = $dataProvider->getDefinition();
77 if (!is_array($definition)) {
78 $definition = array();
81 $definition[
'name'] = $columnName;
82 $columnSettings[] = $definition;
84 return $columnSettings;
95 $columnSettings = array();
96 foreach ($this->columns as $columnName => $_) {
97 $columnSettings[] =
'TYPO3.Workspaces.extension.AdditionalColumn.' . $columnName;
99 return $columnSettings;
108 public function getData(\TYPO3\CMS\Workspaces\Domain\Model\CombinedRecord $combinedRecord)
110 $recordData = array();
111 foreach ($this->columns as $columnName => $dataProvider) {
112 $data = $dataProvider->getData($combinedRecord);
114 if ($data !== null) {
115 $recordData[$columnName] = $data;