|
|
@@ -272,12 +272,6 @@ class ProductFamilyController extends AdminController |
|
|
|
$entity->addProduct($newProduct); |
|
|
|
} |
|
|
|
}else { |
|
|
|
dump('blop'); |
|
|
|
foreach ($entity->getProducts() as $product) { |
|
|
|
|
|
|
|
dump($product); |
|
|
|
|
|
|
|
} |
|
|
|
//Récupère le product origin |
|
|
|
$originProducts = $this->em->getRepository(ProductInterface::class)->findBy(array( |
|
|
|
'productFamily' => $entity->getId(), |
|
|
@@ -301,26 +295,20 @@ class ProductFamilyController extends AdminController |
|
|
|
if ($entity->getActiveProducts()) { |
|
|
|
$originProduct->setStatus(-1); |
|
|
|
} else { |
|
|
|
foreach ($entity->getProducts() as $product) { |
|
|
|
/*foreach ($entity->getProducts() as $product) { |
|
|
|
$product->setStatus(0); |
|
|
|
} |
|
|
|
}*/ |
|
|
|
$originProduct->setStatus(1); |
|
|
|
} |
|
|
|
|
|
|
|
//Enregistrement |
|
|
|
$originProduct->setProductFamily($entity); |
|
|
|
$this->em->persist($originProduct); |
|
|
|
$entity->addProduct($originProduct); |
|
|
|
|
|
|
|
foreach ($entity->getProducts() as $product) { |
|
|
|
$product->setProductFamily($entity); |
|
|
|
$this->em->persist($product); |
|
|
|
$entity->addProduct($product); |
|
|
|
dump($product); |
|
|
|
|
|
|
|
} |
|
|
|
//die(); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
@@ -353,9 +341,7 @@ class ProductFamilyController extends AdminController |
|
|
|
$id = $this->request->query->get('id'); |
|
|
|
$easyadmin = $this->request->attributes->get('easyadmin'); |
|
|
|
$entity = $easyadmin['item']; |
|
|
|
foreach ($entity->getProducts() as $product){ |
|
|
|
dump($product); |
|
|
|
} |
|
|
|
|
|
|
|
if ($this->request->isXmlHttpRequest() && $property = $this->request->query->get('property')) { |
|
|
|
$newValue = 'true' === mb_strtolower($this->request->query->get('newValue')); |
|
|
|
$fieldsMetadata = $this->entity['list']['fields']; |