Browse Source

Merge branch 'develop' of https://forge.laclic.fr/Laclic/CaracoleBundle into develop

packProduct
Guillaume 3 years ago
parent
commit
8e0b286675
2 changed files with 10 additions and 4 deletions
  1. +2
    -2
      Controller/Setting/SettingAdminController.php
  2. +8
    -2
      Transformer/Order/OrderShopTransformer.php

+ 2
- 2
Controller/Setting/SettingAdminController.php View File



if ($entity) { if ($entity) {
$form = $this->createForm($formClass, $entity); $form = $this->createForm($formClass, $entity);
dump($request);
$form->handleRequest($request); $form->handleRequest($request);


if ($form->isSubmitted() && $form->isValid()) { if ($form->isSubmitted() && $form->isValid()) {
] ]
); );
} }
}
}

+ 8
- 2
Transformer/Order/OrderShopTransformer.php View File

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;

Loading…
Cancel
Save