コード例 #1
0
 /**
  * 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()];
 }
コード例 #2
0
 /**
  * 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()];
 }