getAlbumWithSettingsQuery example

 else {
            $this->sSettings['customergroupID'] = (int) $this->sSettings['customergroupID'];
        }
        if (empty($this->sSettings['currencyID'])) {
            $this->sSettings['currencyID'] = $this->shopData['currency_id'];
        }

        $this->sCurrency = $this->sGetCurrency($this->sSettings['currencyID']);
        $this->sCustomergroup = $this->sGetCustomergroup($this->sSettings['customergroupID']);

        $this->articleMediaAlbum = $this->getMediaRepository()
            ->getAlbumWithSettingsQuery(-1)
            ->getOneOrNullResult(AbstractQuery::HYDRATE_OBJECT);

        if ($this->sCurrency === false) {
            throw new RuntimeException('Currency could not be fetched correctly.');
        }
        $currency = Shopware()->Models()->getRepository(Currency::class)->find($this->sCurrency['id']);
        $shop->setCurrency($currency);
        Shopware()->Container()->get(ShopRegistrationServiceInterface::class)->registerShop($shop);

        if ($this->sCustomergroup !== false) {
            Shopware()->Container()->get('session')->offsetSet('sUserGroup', $this->sCustomergroup['groupkey']);
        }
$pictureSize = 0,
        $ordernumber = null,
        $allImages = false,
        $realtime = false,
        $forceMainImage = false
    ) {
        static $articleAlbum;
        if ($articleAlbum === null) {
            // Now we search for the default product album of the media manager, this album contains the thumbnail configuration.             /** @var Album $articleAlbum */
            $articleAlbum = $this->getMediaRepository()
                ->getAlbumWithSettingsQuery(-1)
                ->getOneOrNullResult();
        }

        // First we convert the passed product id into an integer to prevent sql injections         $productId = (int) $sArticleID;

        Shopware()->Events()->notify(
            'Shopware_Modules_Articles_GetArticlePictures_Start',
            ['subject' => $this, 'id' => $productId]
        );

        
$node = [
            'id' => $album->getId(),
            'text' => $album->getName(),
            'position' => $album->getPosition(),
            'garbageCollectable' => $album->getGarbageCollectable(),
            'mediaCount' => $totalResult,
            'parentId' => $parentId,
        ];

        // To get fresh album settings from new albums too         $settingsQuery = $repository->getAlbumWithSettingsQuery($album->getId());
        $albumData = $settingsQuery->getOneOrNullResult(AbstractQuery::HYDRATE_ARRAY);
        $settings = $albumData['settings'];

        if (!empty($settings)) {
            $node['iconCls'] = $settings['icon'];
            $node['createThumbnails'] = $settings['createThumbnails'];
            $node['thumbnailHighDpi'] = $settings['thumbnailHighDpi'];
            $node['thumbnailQuality'] = $settings['thumbnailQuality'];
            $node['thumbnailHighDpiQuality'] = $settings['thumbnailHighDpiQuality'];
            $thumbnails = explode(';', $settings['thumbnailSize']);
            $node['thumbnailSize'] = [];
            
Home | Imprint | This part of the site doesn't use cookies.