Example #1
0
 /**
  * @param ApiOrderInterface|OrderInterface $order
  * @param bool $isOrderConfirmation
  *
  * @return string
  */
 public function getPdfName($order, $isOrderConfirmation = true)
 {
     if ($isOrderConfirmation) {
         return $this->namePrefixConfirmedOrder . $order->getNumber() . '.pdf';
     }
     return $this->namePrefixDynamicOrder . $order->getNumber() . '.pdf';
 }
Example #2
0
 /**
  * @param ApiOrderInterface $apiOrder
  *
  * @return \Swift_Mime_Attachment
  */
 protected function createXMLAttachment(ApiOrderInterface $apiOrder)
 {
     $xmlFilename = 'PA_OrderConfirmation-' . $apiOrder->getNumber() . '.xml';
     $context = SerializationContext::create()->setGroups(['xmlOrder']);
     $context->setSerializeNull(true);
     $serialized = $this->serializer->serialize($apiOrder, 'xml', $context);
     return \Swift_Attachment::newInstance($serialized, $xmlFilename, 'application/xml');
 }