setPreviewSecret example

$emotion->setSeoKeywords($data['__emotion_seo_keywords']);
        $emotion->setSeoDescription($data['__emotion_seo_description']);
        $emotion->setCreateDate($this->createDate($data['__emotion_create_date']));
        $emotion->setModifiedDate($this->createDate($data['__emotion_modified']));
        $emotion->setTemplateId((int) $data['__emotion_template_id']);
        $emotion->setDevices(array_map('\intval', explode(',', $data['__emotion_device'])));
        $emotion->setFullscreen((bool) $data['__emotion_fullscreen']);
        $emotion->setMode($data['__emotion_mode']);
        $emotion->setPosition((int) $data['__emotion_position']);
        $emotion->setParentId($data['__emotion_parent_id'] !== null ? (int) $data['__emotion_parent_id'] : null);
        $emotion->setIsPreview((bool) $data['__emotion_preview_id']);
        $emotion->setPreviewSecret($data['__emotion_preview_secret']);
        $emotion->setCategoryIds(array_map('\intval', explode(',', $data['__emotion_category_ids'])));
        $emotion->setShopIds(array_map('\intval', explode(',', $data['__emotion_shop_ids'])));

        // assign template         $this->assignTemplate($emotion$data);

        // assign attribute         if (!empty($data['__emotionAttribute_id'])) {
            $this->attributeHydrator->addAttribute($emotion$data, 'emotionAttribute');
        }

        
$emotion->setMode($data['mode']);
        $emotion->setRows($data['rows']);
        $emotion->setCols($data['cols']);
        $emotion->setCellSpacing($data['cellSpacing']);
        $emotion->setCellHeight($data['cellHeight']);
        $emotion->setArticleHeight($data['articleHeight']);
        $emotion->setIsLandingPage(!empty($data['isLandingPage']));
        $emotion->setSeoTitle($data['seoTitle']);
        $emotion->setSeoKeywords($data['seoKeywords']);
        $emotion->setSeoDescription($data['seoDescription']);
        $emotion->setPreviewId($data['previewId'] ?? null);
        $emotion->setPreviewSecret($data['previewSecret'] ?? null);
        $emotion->setCustomerStreamIds($data['customerStreamIds'] ?: null);
        $emotion->setReplacement($data['replacement'] ?: null);
        $emotion->setListingVisibility($data['listingVisibility']);

        $this->get('models')->persist($emotion);
        $this->get('models')->flush();

        return $emotion;
    }

    /** * Helper method for creating associated emotion elements. */
Home | Imprint | This part of the site doesn't use cookies.