setDocumentId example

if ($documentMediaId !== null || $document->isStatic()) {
            return $documentMediaId;
        }

        $operation = new DocumentGenerateOperation(
            $document->getOrderId(),
            FileTypes::PDF,
            $document->getConfig(),
            $document->getReferencedDocumentId()
        );

        $operation->setDocumentId($document->getId());

        /** @var DocumentTypeEntity $documentType */
        $documentType = $document->getDocumentType();

        $documentStruct = $this->documentGenerator->generate(
            $documentType->getTechnicalName(),
            [$document->getOrderId() => $operation],
            $context
        )->getSuccess()->first();

        if ($documentStruct === null) {
            
'documentID' => $documentID,
            ]
        );

        /** @var Shopware_Models_Document_Order $documentOrder */
        $documentOrder = Enlight_Class::Instance('Shopware_Models_Document_Order', [$orderID$config]);

        $document->setOrder($documentOrder);

        $document->setConfig($config);

        $document->setDocumentId($documentID);
        if (!empty($orderID)) {
            $document->_subshop = Shopware()->Db()->fetchRow(
                "SELECT s.id, m.document_template_id as doc_template_id, m.template_id as template_id, (SELECT CONCAT('templates/', template) FROM s_core_templates WHERE id = m.document_template_id) as doc_template, (SELECT CONCAT('templates/', template) FROM s_core_templates WHERE id = m.template_id) as template, s.id as isocode, s.locale_id as locale FROM s_order, s_core_shops s LEFT JOIN s_core_shops m ON m.id=s.main_id OR (s.main_id IS NULL AND m.id=s.id) WHERE s_order.language = s.id AND s_order.id = ?",


        $documentId = $document->getId();

        $operation = new DocumentGenerateOperation(
            $document->getOrderId(),
            FileTypes::PDF,
            $document->getConfig(),
            $document->getReferencedDocumentId()
        );

        $operation->setDocumentId($documentId);

        /** @var DocumentTypeEntity $documentType */
        $documentType = $document->getDocumentType();

        $documentStruct = $this->generate(
            $documentType->getTechnicalName(),
            [$document->getOrderId() => $operation],
            $context
        )->getSuccess()->first();

        if ($documentStruct === null) {
            
Home | Imprint | This part of the site doesn't use cookies.