getName()), '-')); $fallback = $productDTO->getSku()?->getValue() ?? $productDTO->getBarcode()?->getValue() ?? $productDTO->getId(); $slug = $base !== '' ? $base : strtolower(trim((string) preg_replace('/[^a-z0-9]+/i', '-', $fallback), '-')); if ($suffix !== null && $suffix !== '') { return sprintf('%s-%s', $slug, strtolower(trim((string) preg_replace('/[^a-z0-9]+/i', '-', $suffix), '-'))); } return $slug; } }