mirror of
https://github.com/SkillDisplay/TYPO3ContentElements.git
synced 2024-12-22 22:36:09 +01:00
28 lines
662 B
PHP
28 lines
662 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace SkillDisplay\Typo3Extension;
|
|
|
|
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(),
|
|
];
|
|
}
|
|
}
|
|
}
|