getUseParentConfiguration example

'id' => $subFolder->getId(),
                'parentId' => $folder->getParentId(),
            ];
        }

        $subFolders = $subFolders->filterByProperty('useParentConfiguration', true);

        if (\count($subFolders) === 0) {
            $this->deleteOwnConfiguration($folder$context);
        }

        if ((!$folder->getUseParentConfiguration()) && \count($subFolders) > 1) {
            /** @var MediaFolderCollection $collection */
            $collection = $subFolders->getEntities();
            $payload = $this->duplicateFolderConfig($collection$payload$context);
        }

        $this->mediaFolderRepo->update(array_values($payload)$context);
    }

    /** * @param array<string, array<string, string|bool|null>> $payload * * @return array<string, array<string, string|bool|null>> */
$config = $this->mediaFolderConfigRepo->search(new Criteria([$configId])$this->context)->get($configId);
        static::assertNotNull($config);
    }

    private function assertConfig(
        MediaFolderEntity $folder,
        bool $useParentConfiguration,
        bool $createThumbnails,
        bool $keepAspectRatio,
        int $thumbnailQuality
    ): void {
        static::assertEquals($useParentConfiguration$folder->getUseParentConfiguration());
        static::assertEquals($createThumbnails$folder->getConfiguration()?->getCreateThumbnails());
        static::assertEquals($keepAspectRatio$folder->getConfiguration()?->getKeepAspectRatio());
        static::assertEquals($thumbnailQuality$folder->getConfiguration()?->getThumbnailQuality());
    }

    private function assertConfigIsSame(MediaFolderEntity $folder, MediaFolderEntity $childFolder): void
    {
        static::assertEquals($folder->getConfigurationId()$childFolder->getConfigurationId());
    }
}
Home | Imprint | This part of the site doesn't use cookies.