Files
typo3-13/packages/ep_theme/Classes/DataProcessing/TeaserImageProcessor.php
T
frommeandClaude Opus 5.5 3fa4a81e97 chore: remove the outdated copyright notices
The GPL headers named dreipunktnull and an old address and no longer
match the license of the code.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-26 10:41:24 +01:00

35 lines
1010 B
PHP

<?php
namespace EP\EpTheme\DataProcessing;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer;
use TYPO3\CMS\Frontend\ContentObject\DataProcessorInterface;
use TYPO3\CMS\Frontend\Resource\FileCollector;
class TeaserImageProcessor implements DataProcessorInterface
{
/**
* @param ContentObjectRenderer $cObj
* @param array $contentObjectConfiguration
* @param array $processorConfiguration
* @param array $processedData
*
* @return array
*/
public function process(
ContentObjectRenderer $cObj,
array $contentObjectConfiguration,
array $processorConfiguration,
array $processedData
) {
$imageFileCollector = GeneralUtility::makeInstance(FileCollector::class);
$imageFileCollector->addFilesFromRelation('tt_content', 'assets', $cObj->data);
$processedData['teaserImage'] = reset($imageFileCollector->getFiles());
return $processedData;
}
}