Nelze vybrat více než 25 témat
Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
|
- <?php
-
- namespace Lc\CaracoleBundle\Builder\File;
-
- use Lc\CaracoleBundle\Model\File\DocumentInterface;
- use Lc\CaracoleBundle\Model\Order\OrderShopInterface;
- use Lc\CaracoleBundle\Resolver\Reference\DocumentReferenceResolver;
-
- class DocumentBuilder
- {
- protected DocumentReferenceResolver $documentReferenceResolver;
-
- public function __construct(DocumentReferenceResolver $documentReferenceResolver)
- {
- $this->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;
- }
-
- }
|