protected function getContentForPdf(ApiOrderInterface $apiOrder)
    {
        $order = $apiOrder->getEntity();

        $customerNumber = null;

        if ($order->getCustomerAccount()) {
            $customerNumber = $order->getCustomerAccount()->getNumber();
        } else {
            $customerNumber = sprintf('%05d', $order->getCustomerContact()->getId());
        }

        $data = [
            'recipient' => $order->getDeliveryAddress(),
            'responsibleContact' => $order->getResponsibleContact(),
            'deliveryAddress' => $order->getDeliveryAddress(),
            'customerContact' => $order->getCustomerContact(),
            'billingAddress' => $order->getInvoiceAddress(),
            'order' => $order,
            'customerNumber' => $customerNumber,
            'orderApiEntity' => $apiOrder,
            'itemApiEntities' => $apiOrder->getItems(),
            'templateBasePath' => $this->templateBasePath,
            'templateMacrosPath' => $this->templateMacrosPath,
            'website_locale' => $this->websiteLocale,
        ];

        return $data;
    }
protected function getContentForPdf(ApiOrderInterface $apiOrder)
    {
        $order = $apiOrder->getEntity();

        $customerNumber = null;

        if ($order->getCustomerAccount()) {
            $customerNumber = $order->getCustomerAccount()->getNumber();
        } else {
            $customerNumber = sprintf('%05d', $order->getCustomerContact()->getId());
        }

        $data = [
            'recipient' => $order->getDeliveryAddress(),
            'responsibleContact' => $order->getResponsibleContact(),
            'deliveryAddress' => $order->getDeliveryAddress(),
            'customerContact' => $order->getCustomerContact(),
            'billingAddress' => $order->getInvoiceAddress(),
            'order' => $order,
            'customerNumber' => $customerNumber,
            'orderApiEntity' => $apiOrder,
            'itemApiEntities' => $apiOrder->getItems(),
            'templateBasePath' => $this->templateBasePath,
            'templateMacrosPath' => $this->templateMacrosPath,
            'website_locale' => $this->websiteLocale,
        ];

        return $data;
    }
protected function getContentForPdf ( ApiOrderInterface $ apiOrder ) { $ order = $ apiOrder -> getEntity ( ) ; $ customerNumber = null ; if ( $ order -> getCustomerAccount ( ) ) { $ customerNumber = $ order -> getCustomerAccount ( ) -> getNumber ( ) ; } else { $ customerNumber = sprintf ( '%05d' , $ order -> getCustomerContact ( ) -> getId ( ) ) ; } $ data = [ 'recipient' => $ order -> getDeliveryAddress ( ) , 'responsibleContact' => $ order -> getResponsibleContact ( ) , 'deliveryAddress' => $ order -> getDeliveryAddress ( ) , 'customerContact' => $ order -> getCustomerContact ( ) , 'billingAddress' => $ order -> getInvoiceAddress ( ) , 'order' => $ order , 'customerNumber' => $ customerNumber , 'orderApiEntity' => $ apiOrder , 'itemApiEntities' => $ apiOrder -> getItems ( ) , 'templateBasePath' => $ this -> templateBasePath , 'templateMacrosPath' => $ this -> templateMacrosPath , 'website_locale' => $ this -> websiteLocale , ] ; return $ data ; }
Function that sets data array for pdf rendering.

@param ApiOrderInterface $apiOrder

@return array
Function that sets data array for pdf rendering .