|
|
@@ -3,12 +3,14 @@ |
|
|
|
namespace Lc\CaracoleBundle\Transformer\Order; |
|
|
|
|
|
|
|
use App\Entity\Order\OrderShop; |
|
|
|
use EasyCorp\Bundle\EasyAdminBundle\Router\AdminUrlGenerator; |
|
|
|
use Lc\CaracoleBundle\Model\Order\OrderShopInterface; |
|
|
|
use Lc\CaracoleBundle\Resolver\OrderShopResolver; |
|
|
|
use Lc\CaracoleBundle\Solver\Order\OrderShopSolver; |
|
|
|
use Lc\CaracoleBundle\Solver\Price\PriceSolver; |
|
|
|
use Lc\SovBundle\Model\User\UserInterface; |
|
|
|
use Lc\SovBundle\Translation\TranslatorAdmin; |
|
|
|
use Symfony\Component\Routing\Generator\UrlGeneratorInterface; |
|
|
|
|
|
|
|
class OrderShopTransformer |
|
|
|
{ |
|
|
@@ -16,13 +18,16 @@ class OrderShopTransformer |
|
|
|
protected OrderShopSolver $orderShopSolver; |
|
|
|
protected OrderShopResolver $orderShopResolver; |
|
|
|
protected TranslatorAdmin $translatorAdmin; |
|
|
|
protected UrlGeneratorInterface $urlGenerator; |
|
|
|
|
|
|
|
public function __construct(PriceSolver $priceSolver, OrderShopSolver $orderShopSolver, OrderShopResolver $orderShopResolver, TranslatorAdmin $translatorAdmin) |
|
|
|
|
|
|
|
public function __construct(PriceSolver $priceSolver, OrderShopSolver $orderShopSolver, OrderShopResolver $orderShopResolver, TranslatorAdmin $translatorAdmin, UrlGeneratorInterface $urlGenerator) |
|
|
|
{ |
|
|
|
$this->priceSolver = $priceSolver; |
|
|
|
$this->orderShopSolver = $orderShopSolver; |
|
|
|
$this->orderShopResolver = $orderShopResolver; |
|
|
|
$this->translatorAdmin = $translatorAdmin; |
|
|
|
$this->urlGenerator = $urlGenerator; |
|
|
|
} |
|
|
|
|
|
|
|
// getOrderDatas |
|
|
@@ -98,7 +103,7 @@ class OrderShopTransformer |
|
|
|
{ |
|
|
|
$data = array(); |
|
|
|
foreach ($order->getOrderPayments() as $orderPayment) { |
|
|
|
dump($orderPayment->getEditable()); |
|
|
|
|
|
|
|
$data[$orderPayment->getId()] = array( |
|
|
|
'id' => $orderPayment->getId(), |
|
|
|
'reference' => $orderPayment->getReference(), |
|
|
@@ -181,6 +186,7 @@ class OrderShopTransformer |
|
|
|
'type' => $orderDocument->getType(), |
|
|
|
'isSent' => $orderDocument->getIsSent(), |
|
|
|
'orderReference' => $order->getReference(), |
|
|
|
'link' => $this->urlGenerator->generate('document_download', ['id'=> $orderDocument->getId()]) |
|
|
|
); |
|
|
|
} |
|
|
|
return $data; |