getDefaultProfileId example

/** @var string $id */
        $id = $profileRepository->searchIds($criteria, Context::createDefaultContext())->firstId();

        return $id;
    }

    protected function cloneDefaultProfile(string $entity): ImportExportProfileEntity
    {
        /** @var EntityRepository $profileRepository */
        $profileRepository = $this->getContainer()->get('import_export_profile.repository');

        $systemDefaultProfileId = $this->getDefaultProfileId($entity);
        $newId = Uuid::randomHex();
        $profileRepository->clone($systemDefaultProfileId, Context::createDefaultContext()$newId);

        // get the cloned profile         return $profileRepository->search(new Criteria([$newId]), Context::createDefaultContext())->first();
    }

    /** * @param array<array<string, mixed>> $mappings */
    protected function updateProfileMapping(string $profileId, array $mappings): void
    {
public function testImportExportHandlerDispatchesMessage(): void
    {
        /** @var TraceableMessageBus $messageBus */
        $messageBus = $this->getContainer()->get('messenger.bus.shopware');
        $factory = $this->getContainer()->get(ImportExportFactory::class);
        $context = Context::createDefaultContext();

        $importExportHandler = new ImportExportHandler($messageBus$factory);

        $importExportService = $this->getContainer()->get(ImportExportService::class);

        $profileId = $this->getDefaultProfileId(PropertyGroupOptionDefinition::ENTITY_NAME);

        $expireDate = new \DateTimeImmutable('2099-01-01');
        $file = new UploadedFile(__DIR__ . '/../fixtures/properties.csv', 'properties.csv', 'text/csv');

        $logEntity = $importExportService->prepareImport(
            $context,
            $profileId,
            $expireDate,
            $file
        );

        
Home | Imprint | This part of the site doesn't use cookies.