/**
  * Add attributes to product
  *
  * @param Request $request The request object
  * @param integer $id      The product id to which add attributes
  *
  * @AclAncestor("pim_enrich_product_add_attribute")
  * @return \Symfony\Component\HttpFoundation\RedirectResponse
  */
 public function addAttributesAction(Request $request, $id)
 {
     $product = $this->findProductOr404($id);
     $availableAttributes = new AvailableAttributes();
     $attributesForm = $this->getAvailableAttributesForm($product->getAttributes(), $availableAttributes);
     $attributesForm->submit($request);
     $this->productManager->addAttributesToProduct($product, $availableAttributes);
     $this->addFlash($request, 'success', 'flash.product.attributes added');
     return $this->redirectToRoute('pim_enrich_product_edit', array('id' => $product->getId()));
 }