mirror of
https://github.com/SkillDisplay/TYPO3ContentElements.git
synced 2024-11-22 03:16:10 +01:00
29 lines
662 B
PHP
29 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(),
|
||
|
];
|
||
|
}
|
||
|
}
|
||
|
}
|