Vous ne pouvez pas sélectionner plus de 25 sujets
Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
|
- <?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;
- }
-
- }
|