mirror of
https://github.com/SkillDisplay/TYPO3ContentElements.git
synced 2024-11-22 03:16:10 +01:00
1ee52d852b
[BUGFIX] Use more precise extension key
39 lines
848 B
PHP
39 lines
848 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace SkillDisplay\SkilldisplayContent;
|
|
|
|
use SkillDisplay\PHPToolKit\Entity\Campaign;
|
|
|
|
class TcaEnhancer
|
|
{
|
|
/**
|
|
* @var CampaignsFactory
|
|
*/
|
|
private $campaignsFactory;
|
|
|
|
public function __construct(
|
|
CampaignsFactory $campaignsFactory
|
|
) {
|
|
$this->campaignsFactory = $campaignsFactory;
|
|
}
|
|
|
|
public function getCampaignsForTCA(array &$params): void
|
|
{
|
|
$params['items'] = [
|
|
['', 0],
|
|
];
|
|
|
|
$campaigns = $this->campaignsFactory
|
|
->createFromPageUid($params['row']['pid'])
|
|
->getForUser();
|
|
/** @var Campaign $campaign */
|
|
foreach ($campaigns as $campaign) {
|
|
$params['items'][] = [
|
|
$campaign->getTitle(),
|
|
$campaign->getId(),
|
|
];
|
|
}
|
|
}
|
|
}
|