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