/** * Remove attribute * * @param Request $request * @param integer $id * * @AclAncestor("pim_enrich_attribute_remove") * * @return \Symfony\Component\HttpFoundation\RedirectResponse|Response */ public function removeAction(Request $request, $id) { $attribute = $this->findAttributeOr404($id); $this->validateRemoval($attribute); $this->attributeManager->remove($attribute); if ($request->isXmlHttpRequest()) { return new Response('', 204); } else { return $this->redirectToRoute('pim_enrich_attribute_index'); } }
/** * Remove an attribute. * * @param AbstractAttribute $attribute */ public function remove(AbstractAttribute $attribute) { $this->baseAttributeManager->remove($attribute); }