TYPO3ContentElements/Classes/TcaEnhancer.php
Markus Klein 9f43ea427b [BUGFIX] Use more precise extension key
To avoid name clashes we use a more precise extension key.
Also the namespace is adjusted accordingly.

Resolves: #8
2021-01-29 10:32:30 +01:00

28 lines
667 B
PHP

<?php
declare(strict_types=1);
namespace SkillDisplay\SkilldisplayContent;
use SkillDisplay\PHPToolKit\Api\Campaigns;
use SkillDisplay\PHPToolKit\Entity\Campaign;
use TYPO3\CMS\Core\Utility\GeneralUtility;
class TcaEnhancer
{
public function getCampaignsForTCA(array $params): void
{
$params['items'] = [
['', 0],
];
$campaigns = GeneralUtility::makeInstance(Campaigns::class)->getForUser();
/** @var Campaign $campaign */
foreach ($campaigns as $campaign) {
$params['items'][] = [
$campaign->getTitle(),
$campaign->getId(),
];
}
}
}