From 244b0d9b12d783244a55b42a8ab7727cb48fab4d Mon Sep 17 00:00:00 2001 From: Daniel Siepmann Date: Wed, 5 Sep 2018 13:42:13 +0200 Subject: [PATCH] TASK: Refactor column value in own method This allows to replace this single part of code in own implementations. --- .../Index/TcaIndexer/RelationResolver.php | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/Classes/Domain/Index/TcaIndexer/RelationResolver.php b/Classes/Domain/Index/TcaIndexer/RelationResolver.php index ae10f68..e992577 100644 --- a/Classes/Domain/Index/TcaIndexer/RelationResolver.php +++ b/Classes/Domain/Index/TcaIndexer/RelationResolver.php @@ -41,14 +41,7 @@ class RelationResolver implements Singleton continue; } - $record[$column] = GeneralUtility::makeInstance($this->getUtilityForMode()) - ::getProcessedValueExtra( - $service->getTableName(), - $column, - $record[$column], - 0, - $record['uid'] - ); + $record[$column] = $this->getColumnValue($record, $column, $service); try { $config = $service->getColumnConfig($column); @@ -107,4 +100,16 @@ class RelationResolver implements Singleton return FrontendUtility::class; } + + protected function getColumnValue(array $record, string $column, TcaTableServiceInterface $service): string + { + $utility = GeneralUtility::makeInstance($this->getUtilityForMode()); + return $utility::getProcessedValueExtra( + $service->getTableName(), + $column, + $record[$column], + 0, + $record['uid'] + ) ?? ''; + } }