Browse Source

Erreur 500 : Argument 1 passed to Lc\CaracoleBundle\Factory\Order\OrderProductFactory::create() must implement interface Lc\CaracoleBundle\Model\Product\ProductInterface, null given #295

develop
Guillaume Bourgeois 2 years ago
parent
commit
74f31426ba
1 changed files with 5 additions and 0 deletions
  1. +5
    -0
      Form/Order/OrderProductsType.php

+ 5
- 0
Form/Order/OrderProductsType.php View File



use App\Repository\Product\ProductFamilyStore; use App\Repository\Product\ProductFamilyStore;
use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityManagerInterface;
use Http\Discovery\Exception\NotFoundException;
use Lc\CaracoleBundle\Factory\Order\OrderProductFactory; use Lc\CaracoleBundle\Factory\Order\OrderProductFactory;
use Lc\CaracoleBundle\Solver\Product\ProductFamilySolver; use Lc\CaracoleBundle\Solver\Product\ProductFamilySolver;
use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\AbstractType;
} }
} }


if(is_null($product)) {
throw new NotFoundException('Aucun Product trouvé pour le ProductFamily #'.$productFamily->getId());
}

$orderProduct = $this->orderProductFactory->create($product, 1); $orderProduct = $this->orderProductFactory->create($product, 1);


$builder->add('order_product_0', OrderProductType::class, [ $builder->add('order_product_0', OrderProductType::class, [

Loading…
Cancel
Save