documentReferenceResolver = $documentReferenceResolver; } public function initFromOrderShop(DocumentInterface $document, OrderShopInterface $orderShop) { $merchantAddress = $orderShop->getMerchant()->getAddress(); $buyerAddress = $orderShop->getInvoiceAddress(); $document->setReference($this->documentReferenceResolver->buildReference($orderShop->getMerchant())) ; $document->setMerchantAddress($merchantAddress); $document->setBuyerAddress($buyerAddress); $document->setMerchantAddressText($merchantAddress->getSummary()); $document->setBuyerAddressText($buyerAddress->getSummary()); $document->addOrderShop($orderShop); $document->setCreatedBy($orderShop->getUser()); return $document; } }