InvalidDocumentRendererException example

return $document;
    }

    /** * @param DocumentGenerateOperation[] $operations */
    public function generate(string $documentType, array $operations, Context $context): DocumentGenerationResult
    {
        $documentTypeId = $this->getDocumentTypeByName($documentType);

        if ($documentTypeId === null) {
            throw new InvalidDocumentRendererException($documentType);
        }

        $rendered = $this->rendererRegistry->render($documentType$operations$contextnew DocumentRendererConfig());

        $result = new DocumentGenerationResult();

        foreach ($rendered->getErrors() as $orderId => $error) {
            $result->addError($orderId$error);
        }

        $records = [];

        
Home | Imprint | This part of the site doesn't use cookies.