[TASK] Improve abstract eid controller

This commit is contained in:
Philipp Dieter 2021-08-09 22:14:54 +02:00
parent fa2ab93619
commit a3c8acf3be

View File

@ -23,6 +23,8 @@ use TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface;
use TYPO3\CMS\Extbase\Object\ObjectManager; use TYPO3\CMS\Extbase\Object\ObjectManager;
use TYPO3\CMS\Frontend\Plugin\AbstractPlugin; use TYPO3\CMS\Frontend\Plugin\AbstractPlugin;
use TYPO3\CMS\Frontend\Utility\EidUtility; use TYPO3\CMS\Frontend\Utility\EidUtility;
use TYPO3\CMS\Extbase\Reflection\ClassSchema;
use TYPO3\CMS\Extbase\Reflection\ReflectionService;
/** /**
* AbstractEIDController * AbstractEIDController
@ -94,6 +96,9 @@ class AbstractEIDController
$this->configurationManager = $this->objectManager->get( $this->configurationManager = $this->objectManager->get(
ConfigurationManagerInterface::class ConfigurationManagerInterface::class
); );
$this->apiUtility = $this->objectManager->get(
\Cjel\TemplatesAide\Utility\ApiUtility::class
);
$this->configurationManager->setConfiguration(array()); $this->configurationManager->setConfiguration(array());
$frameworkConfiguration = $this->configurationManager->getConfiguration( $frameworkConfiguration = $this->configurationManager->getConfiguration(
ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK, ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK,
@ -114,6 +119,20 @@ class AbstractEIDController
$this->importLogger = $this->logManager->getLogger( $this->importLogger = $this->logManager->getLogger(
'importLogger' 'importLogger'
); );
$this->reflectionService = GeneralUtility::makeInstance(
ReflectionService::class, GeneralUtility::makeInstance(
CacheManager::class
)
);
$classInfo = $this->reflectionService->getClassSchema(
get_class($this)
);
foreach ($classInfo->getInjectMethods() as $method => $className) {
$class = $this->objectManager->get(
$className
);
$this->{$method}($class);
}
} }
/** /**