/**
  * Edit an association type
  *
  * @param int     $id
  *
  * @Template
  * @AclAncestor("pim_enrich_associationtype_edit")
  *
  * @return array
  */
 public function editAction($id)
 {
     $associationType = $this->assocTypeRepo->find($id);
     if (!$associationType) {
         throw new NotFoundHttpException(sprintf('%s entity not found', 'PimCatalogBundle:AssociationType'));
     }
     if ($this->assocTypeHandler->process($associationType)) {
         $this->request->getSession()->getFlashBag()->add('success', new Message('flash.association type.updated'));
         return new RedirectResponse($this->router->generate('pim_enrich_associationtype_edit', ['id' => $id]));
     }
     $usageCount = $this->assocRepository->countForAssociationType($associationType);
     return ['form' => $this->assocTypeForm->createView(), 'usageCount' => $usageCount];
 }