コード例 #1
0
 /**
  * Remove an association type
  *
  * @param AssociationType $associationType
  *
  * @AclAncestor("pim_enrich_association_type_remove")
  * @return Response|RedirectResponse
  */
 public function removeAction(AssociationType $associationType)
 {
     $this->assocTypeManager->remove($associationType);
     if ($this->getRequest()->isXmlHttpRequest()) {
         return new Response('', 204);
     } else {
         return $this->redirectToRoute('pim_enrich_association_type_index');
     }
 }
コード例 #2
0
 /**
  * Prepare fields list for CSV headers
  *
  * @param array $attributesList
  *
  * @return array
  */
 protected function prepareFieldsList(array $attributesList = [])
 {
     $fieldsList = $this->prepareAttributesList($attributesList);
     $fieldsList[] = ProductNormalizer::FIELD_FAMILY;
     $fieldsList[] = ProductNormalizer::FIELD_CATEGORY;
     $fieldsList[] = ProductNormalizer::FIELD_GROUPS;
     $associationTypes = $this->assocTypeManager->getAssociationTypes();
     foreach ($associationTypes as $associationType) {
         $fieldsList[] = sprintf('%s-groups', $associationType->getCode());
         $fieldsList[] = sprintf('%s-products', $associationType->getCode());
     }
     return $fieldsList;
 }