/** * Edit attribute group * * @param AttributeGroup $group * * @Template * @AclAncestor("pim_enrich_attributegroup_edit") * * @return array */ public function editAction(AttributeGroup $group) { $groups = $this->attributeGroupRepo->getIdToLabelOrderedBySortOrder(); if ($this->formHandler->process($group)) { $this->addFlash('success', 'flash.attribute group.updated'); return $this->redirectToRoute('pim_enrich_attributegroup_edit', ['id' => $group->getId()]); } return ['groups' => $groups, 'group' => $group, 'form' => $this->form->createView(), 'attributesForm' => $this->getAvailableAttributesForm($this->getGroupedAttributes())->createView()]; }
/** * Edit attribute group * * @param AttributeGroup $group * * @Template * @AclAncestor("pim_enrich_attributegroup_edit") * * @return array */ public function editAction(AttributeGroup $group) { $groups = $this->attributeGroupRepo->getIdToLabelOrderedBySortOrder(); if ($this->formHandler->process($group)) { $this->request->getSession()->getFlashBag()->add('success', new Message('flash.attribute group.updated')); return new RedirectResponse($this->router->generate('pim_enrich_attributegroup_edit', ['id' => $group->getId()])); } return ['groups' => $groups, 'group' => $group, 'form' => $this->form->createView(), 'attributesForm' => $this->getAvailableAttributesForm($this->getGroupedAttributes())->createView()]; }