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