getConfigurationId example

$payload[$folder->getId()]['useParentConfiguration'] = false;
            $payload[$folder->getId()]['configurationId'] = $configurationId;
        }

        return $payload;
    }

    private function deleteOwnConfiguration(MediaFolderEntity $folder, Context $context): void
    {
        if ($folder->getUseParentConfiguration() === false) {
            $this->mediaFolderConfigRepo->delete([['id' => $folder->getConfigurationId()]]$context);
        }
    }

    private function cloneConfiguration(string $configId, Context $context): string
    {
        $newId = Uuid::randomHex();
        $this->mediaFolderConfigRepo->clone($configId$context$newId);

        return $newId;
    }

    
 $context);

        $criteria = new Criteria();
        $criteria->addAssociation('configuration');

        $collection = $mediaFolderRepository->search($criteria$context)->getEntities();

        /** @var MediaFolderEntity $mediaFolder */
        $mediaFolder = $collection->get($folderId);

        static::assertEquals('default folder', $mediaFolder->getName());
        static::assertNotNull($mediaFolder->getConfigurationId());
        static::assertNotNull($mediaFolder->getConfiguration());
        static::assertTrue($mediaFolder->getConfiguration()->getCreateThumbnails());
    }

    public function testCreatedMediaFolderIsSetInConfiguration(): void
    {
        $context = Context::createDefaultContext();
        $mediaFolderRepository = $this->getContainer()->get('media_folder.repository');

        $folderId = Uuid::randomHex();
        $configurationId = Uuid::randomHex();

        

                'id' => $ids->get('parent'),
                'configuration' => [
                    'id' => $updatedId,
                    'createThumbnails' => false,
                ],
            ],
        ]$this->context);

        $children = $this->folderRepository->search(new Criteria($ids->getList(['child-1', 'child-1-1']))$this->context);

        static::assertEquals($updatedId$children->get($ids->get('child-1'))->getConfigurationId());
        static::assertEquals($updatedId$children->get($ids->get('child-1-1'))->getConfigurationId());
    }

    public function testOnRefreshItUpdatesOwnConfig(): void
    {
        $parentId = Uuid::randomHex();
        $child1Id = Uuid::randomHex();
        $child1_1Id = Uuid::randomHex();
        $child1_1_1Id = Uuid::randomHex();
        $configId = Uuid::randomHex();
        $childConfigId = Uuid::randomHex();

        
$this->setFixtureContext($this->context);
        $media = $this->getJpgWithFolder();

        $mediaFolderId = $media->getMediaFolderId();
        static::assertIsString($mediaFolderId);

        $mediaFolder = $this->mediaFolderRepo
            ->search(new Criteria(array_filter([$mediaFolderId]))$this->context)
            ->get($mediaFolderId);
        static::assertInstanceOf(MediaFolderEntity::class$mediaFolder);

        $configId = $mediaFolder->getConfigurationId();

        $this->mediaFolderService->dissolve($mediaFolderId$this->context);

        $this->assertMediaFolderIsDeleted($media);
        $this->assertMediaHasNoFolder($media);
        static::assertIsString($configId);
        $this->assertConfigIsDeleted($configId);
    }

    public function testDissolveChildToRootLevel(): void
    {
        
Home | Imprint | This part of the site doesn't use cookies.