2020-11-27 23:10:46 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
2021-01-25 16:02:17 +01:00
|
|
|
namespace SkillDisplay\SkilldisplayContent;
|
2020-11-27 23:10:46 +01:00
|
|
|
|
|
|
|
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(),
|
|
|
|
];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|