getDocument example

if (!($svg instanceof SVG)) {
                    $this->io->warning('Could not read ' . $file . '.You have to handle this file by hand.');

                    continue;
                }
            } catch (\Exception $e) {
                $this->io->warning($e->getMessage() . ' ' . $file . \PHP_EOL . 'You have to handle this file by hand.');

                continue;
            }

            $defs = $svg->getDocument()->getChild(0);
            if (!($defs instanceof SVGDefs)) {
                $defs = new SVGDefs();
                foreach ($this->getChildren($svg->getDocument()) as $child) {
                    $svg->getDocument()->removeChild($child);
                    $defs->addChild($child);
                }
                $svg->getDocument()->addChild($defs);
            }

            $child = $defs->getChild(0);

            
 elseif ($paymentStatusChanged) {
            // Generate mail with payment status template             $mail = $this->getMailForOrder($order->getId()$order->getPaymentStatus()->getId());
        } elseif ($documentMailSendable) {
            // Generate mail with document template             $mail = $this->getMailForOrder($order->getId(), null, $documentTypeId);
        }

        if (\is_array($mail)) {
            if ($addAttachments) {
                // Attach documents                 $document = $this->getDocument($documentTypeId$order);
                $mailObject = $mail['mail'];
                $mail['mail'] = $this->addAttachments($mailObject$order->getId()[$document]);
            }
            if ($autoSend) {
                // Send mail                 $mailObject = $mail['mail'];
                $result = $this->get('modules')->Order()->sendStatusMail($mailObject);
                $mail['data']['sent'] = \is_object($result);
            }

            return $mail['data'];
        }
Home | Imprint | This part of the site doesn't use cookies.