Files
kupshop/bundles/KupShop/KafkaBundle/Util/KafkaUtilTrait.php
2025-08-02 16:30:27 +02:00

27 lines
514 B
PHP

<?php
declare(strict_types=1);
namespace KupShop\KafkaBundle\Util;
use KupShop\KupShopBundle\Config;
trait KafkaUtilTrait
{
public function getShopTopicName(string $topic): string
{
$dbName = Config::get()['Connection']['database'];
if (isLocalDevelopment()) {
return $dbName;
}
return $topic.'_'.$dbName;
}
public function getShopGroupId(string $groupId): string
{
return Config::get()['Connection']['database'].'-'.$groupId;
}
}