|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ($duplicateOtherMerchantForm->isSubmitted() && $duplicateOtherMerchantForm->isValid()) { |
|
|
if ($duplicateOtherMerchantForm->isSubmitted() && $duplicateOtherMerchantForm->isValid()) { |
|
|
$newEntity = $entityComponent->duplicateEntity($context->getEntity()->getInstance()); |
|
|
$newEntity = $entityComponent->duplicateEntity($context->getEntity()->getInstance()); |
|
|
$entityManager->create($newEntity); |
|
|
|
|
|
$merchant = $duplicateOtherMerchantForm->get('merchants')->getData(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$merchant = $duplicateOtherMerchantForm->get('merchants')->getData(); |
|
|
|
|
|
// |
|
|
if($this->isInstanceOf(ProductFamilyInterface::class)) { |
|
|
if($this->isInstanceOf(ProductFamilyInterface::class)) { |
|
|
$sectionStore = $this->getSectionContainer()->getStore()->setMerchant($merchant); |
|
|
$sectionStore = $this->getSectionContainer()->getStore()->setMerchant($merchant); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
$newEntity->initProductCategories(); |
|
|
$newEntity->initProductCategories(); |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
else { |
|
|
else { |
|
|
$newEntity->setMerchant($merchant); |
|
|
$newEntity->setMerchant($merchant); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
$entityManager->update($newEntity); |
|
|
|
|
|
|
|
|
// |
|
|
|
|
|
// |
|
|
|
|
|
$entityManager->create($newEntity, false); |
|
|
$entityManager->flush(); |
|
|
$entityManager->flush(); |
|
|
|
|
|
|
|
|
$url = $this->get(AdminUrlGenerator::class) |
|
|
$url = $this->get(AdminUrlGenerator::class) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ($duplicateOtherSectionForm->isSubmitted() && $duplicateOtherSectionForm->isValid()) { |
|
|
if ($duplicateOtherSectionForm->isSubmitted() && $duplicateOtherSectionForm->isValid()) { |
|
|
$newEntity = $entityComponent->duplicateEntity($context->getEntity()->getInstance()); |
|
|
$newEntity = $entityComponent->duplicateEntity($context->getEntity()->getInstance()); |
|
|
$em->create($newEntity); |
|
|
|
|
|
|
|
|
$em->create($newEntity, false); |
|
|
$section = $duplicateOtherSectionForm->get('sections')->getData(); |
|
|
$section = $duplicateOtherSectionForm->get('sections')->getData(); |
|
|
$newEntity->setSection($section); |
|
|
$newEntity->setSection($section); |
|
|
$em->update($newEntity); |
|
|
|
|
|
|
|
|
$em->update($newEntity, false); |
|
|
$em->flush(); |
|
|
$em->flush(); |
|
|
|
|
|
|
|
|
$url = $this->get(AdminUrlGenerator::class) |
|
|
$url = $this->get(AdminUrlGenerator::class) |