You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ProductFamilyController.php 24KB

4 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454
  1. <?php
  2. namespace Lc\ShopBundle\Controller\Backend;
  3. use App\Entity\Product;
  4. use Doctrine\ORM\EntityManagerInterface;
  5. use EasyCorp\Bundle\EasyAdminBundle\Event\EasyAdminEvents;
  6. use FOS\UserBundle\Model\UserManagerInterface;
  7. use Lc\ShopBundle\Context\ImageInterface;
  8. use Lc\ShopBundle\Context\OrderShopInterface;
  9. use Lc\ShopBundle\Context\ProductCategoryInterface;
  10. use Lc\ShopBundle\Context\ProductFamilyInterface;
  11. use Lc\ShopBundle\Context\ProductInterface;
  12. use Lc\ShopBundle\Context\ReductionCatalogInterface;
  13. use Lc\ShopBundle\Context\TaxRateInterface;
  14. use Lc\ShopBundle\Form\Backend\Common\AbstractEditPositionType;
  15. use Lc\ShopBundle\Form\Backend\Common\ReductionCatalogType;
  16. use Lc\ShopBundle\Form\Backend\ProductFamily\ProductType;
  17. use Lc\ShopBundle\Model\ProductFamily;
  18. use Lc\ShopBundle\Services\UtilsManager;
  19. use Mailjet\MailjetSwiftMailer\SwiftMailer\MailjetTransport;
  20. use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
  21. use Symfony\Component\Form\Extension\Core\Type\CollectionType;
  22. use Symfony\Component\Form\Extension\Core\Type\HiddenType;
  23. use Symfony\Component\Form\Extension\Core\Type\NumberType;
  24. use Symfony\Component\Form\FormError;
  25. use Symfony\Component\HttpFoundation\Response;
  26. use Symfony\Component\HttpFoundation\Session\SessionInterface;
  27. use Symfony\Component\Security\Core\Security;
  28. use Symfony\Contracts\Translation\TranslatorInterface;
  29. use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface;
  30. class ProductFamilyController extends AdminController
  31. {
  32. private $taxRateClass;
  33. private $choicesTaxRateParam;
  34. private $choicesSupplierTaxRateParam;
  35. private $parameterBag ;
  36. private $productFamilyUtils ;
  37. public function __construct(Security $security, UserManagerInterface $userManager, EntityManagerInterface $em, MailjetTransport $mailjetTransport, UtilsManager $utilsManager, TranslatorInterface $translator, SessionInterface $session, ParameterBagInterface $parameterBag)
  38. {
  39. parent::__construct($security, $userManager, $em, $mailjetTransport, $utilsManager, $translator, $session);
  40. $this->parameterBag = $parameterBag ;
  41. $this->productFamilyUtils = $utilsManager->getProductFamilyUtils() ;
  42. }
  43. public function createEntityFormBuilder($entity, $view, $override = true)
  44. {
  45. $formBuilder = parent::createEntityFormBuilder($entity, $view, false);
  46. $class = $this->em->getClassMetadata(ProductCategoryInterface::class);
  47. $this->taxRateClass = $this->em->getClassMetadata(TaxRateInterface::class);
  48. //$formBuilder->add('productCategories', ProductFamilyCategoriesType::class);
  49. $reductionCatalogRepo = $this->em->getRepository(ReductionCatalogInterface::class);
  50. $reductionCatalogClass = $this->em->getClassMetadata(ReductionCatalogInterface::class);
  51. $reductionCatalog = $reductionCatalogRepo->findOneBy(array('status' => false, 'productFamily' => $entity));
  52. if ($reductionCatalog == null) $reductionCatalog = new $reductionCatalogClass->name;
  53. $formBuilder->add('reductionCatalog', ReductionCatalogType::class, array(
  54. 'mapped' => false,
  55. 'data' => $reductionCatalog
  56. ));
  57. $formBuilder->add('stayOnPage', HiddenType::class, array(
  58. 'required' => false,
  59. 'mapped' => false,
  60. ));
  61. $formBuilder->add('warningMessageType', ChoiceType::class, array(
  62. 'choices' => array(
  63. 'field.default.warningMessageTypeOptions.' . ProductFamily::WARNING_MESSAGE_TYPE_SUCCESS => ProductFamily::WARNING_MESSAGE_TYPE_SUCCESS,
  64. 'field.default.warningMessageTypeOptions.' . ProductFamily::WARNING_MESSAGE_TYPE_ERROR => ProductFamily::WARNING_MESSAGE_TYPE_ERROR,
  65. 'field.default.warningMessageTypeOptions.' . ProductFamily::WARNING_MESSAGE_TYPE_WARNING => ProductFamily::WARNING_MESSAGE_TYPE_WARNING,
  66. 'field.default.warningMessageTypeOptions.' . ProductFamily::WARNING_MESSAGE_TYPE_INFO => ProductFamily::WARNING_MESSAGE_TYPE_INFO
  67. ),
  68. 'translation_domain' => 'lcshop',
  69. 'multiple' => false,
  70. 'expanded' => false,
  71. 'required' => false
  72. ));
  73. $formBuilder->add('behaviorCountStock', ChoiceType::class, array(
  74. 'empty_data' => ProductFamily::BEHAVIOR_COUNT_STOCK_BY_PRODUCT_FAMILY,
  75. 'choices' => array(
  76. 'field.ProductFamily.behaviorCountStockOptions.' . ProductFamily::BEHAVIOR_COUNT_STOCK_BY_MEASURE => ProductFamily::BEHAVIOR_COUNT_STOCK_BY_MEASURE,
  77. 'field.ProductFamily.behaviorCountStockOptions.' . ProductFamily::BEHAVIOR_COUNT_STOCK_BY_PRODUCT_FAMILY => ProductFamily::BEHAVIOR_COUNT_STOCK_BY_PRODUCT_FAMILY,
  78. 'field.ProductFamily.behaviorCountStockOptions.' . ProductFamily::BEHAVIOR_COUNT_STOCK_BY_PRODUCT => ProductFamily::BEHAVIOR_COUNT_STOCK_BY_PRODUCT,
  79. 'field.ProductFamily.behaviorCountStockOptions.' . ProductFamily::BEHAVIOR_COUNT_STOCK_UNLIMITED => ProductFamily::BEHAVIOR_COUNT_STOCK_UNLIMITED
  80. ),
  81. 'translation_domain' => 'lcshop',
  82. 'multiple' => false,
  83. 'expanded' => true
  84. ));
  85. $formBuilder->add('behaviorDisplaySale', ChoiceType::class, array(
  86. 'empty_data' => ProductFamily::BEHAVIOR_DISPLAY_SALE_BY_QUANTITY,
  87. 'choices' => array(
  88. 'field.ProductFamily.behaviorDisplaySaleOptions.' . ProductFamily::BEHAVIOR_DISPLAY_SALE_BY_MEASURE => ProductFamily::BEHAVIOR_DISPLAY_SALE_BY_MEASURE,
  89. 'field.ProductFamily.behaviorDisplaySaleOptions.' . ProductFamily::BEHAVIOR_DISPLAY_SALE_BY_QUANTITY => ProductFamily::BEHAVIOR_DISPLAY_SALE_BY_QUANTITY,
  90. ),
  91. 'translation_domain' => 'lcshop',
  92. 'multiple' => false,
  93. 'expanded' => true
  94. ));
  95. $formBuilder->add('behaviorAddToCart', ChoiceType::class, array(
  96. 'data' => $entity->getBehaviorAddToCart() ? $entity->getBehaviorAddToCart() : 'simple',
  97. 'choices' => array(
  98. 'field.ProductFamily.behaviorAddToCartOptions.' . ProductFamily::BEHAVIOR_ADD_TO_CART_SIMPLE => ProductFamily::BEHAVIOR_ADD_TO_CART_SIMPLE,
  99. 'field.ProductFamily.behaviorAddToCartOptions.' . ProductFamily::BEHAVIOR_ADD_TO_CART_MULTIPLE => ProductFamily::BEHAVIOR_ADD_TO_CART_MULTIPLE
  100. ),
  101. 'translation_domain' => 'lcshop',
  102. 'multiple' => false,
  103. 'expanded' => true
  104. ));
  105. $formBuilder->add('behaviorPrice', ChoiceType::class, array(
  106. 'empty_data' => 'by-piece',
  107. 'choices' => array(
  108. 'field.ProductFamily.behaviorPriceOptions.' . ProductFamily::BEHAVIOR_PRICE_BY_PIECE => ProductFamily::BEHAVIOR_PRICE_BY_PIECE,
  109. 'field.ProductFamily.behaviorPriceOptions.' . ProductFamily::BEHAVIOR_PRICE_BY_REFERENCE_UNIT => ProductFamily::BEHAVIOR_PRICE_BY_REFERENCE_UNIT
  110. ),
  111. 'translation_domain' => 'lcshop',
  112. 'multiple' => false,
  113. 'expanded' => true
  114. ));
  115. $formBuilder->add('multiplyingFactor', NumberType::class, array(
  116. 'mapped' => false,
  117. 'data' => floatval($this->merchantUtils->getMerchantConfig('multiplying-factor')),
  118. ));
  119. $formBuilder->add('propertyOrganicLabel', ChoiceType::class, array(
  120. 'choices' => array(
  121. 'field.ProductFamily.organicLabelOptions.' . ProductFamily::PROPERTY_ORGANIC_LABEL_AB => ProductFamily::PROPERTY_ORGANIC_LABEL_AB,
  122. 'field.ProductFamily.organicLabelOptions.' . ProductFamily::PROPERTY_ORGANIC_LABEL_NP => ProductFamily::PROPERTY_ORGANIC_LABEL_NP,
  123. 'field.ProductFamily.organicLabelOptions.' . ProductFamily::PROPERTY_ORGANIC_LABEL_HVE => ProductFamily::PROPERTY_ORGANIC_LABEL_HVE
  124. ),
  125. 'translation_domain' => 'lcshop',
  126. 'multiple' => false,
  127. 'expanded' => false,
  128. 'required' => false
  129. ));
  130. $formBuilder->add('typeExpirationDate', ChoiceType::class, array(
  131. 'choices' => array(
  132. 'field.default.' . ProductFamily::TYPE_EXPIRATION_DATE_DLC => ProductFamily::TYPE_EXPIRATION_DATE_DLC,
  133. 'field.default.' . ProductFamily::TYPE_EXPIRATION_DATE_DDM => ProductFamily::TYPE_EXPIRATION_DATE_DDM,
  134. 'field.default.' . ProductFamily::TYPE_EXPIRATION_DATE_DLUO => ProductFamily::TYPE_EXPIRATION_DATE_DLUO
  135. ),
  136. 'translation_domain' => 'lcshop',
  137. 'multiple' => false,
  138. 'expanded' => true,
  139. 'required' => false
  140. ));
  141. $formBuilder->add('behaviorStockWeek', ChoiceType::class, array(
  142. 'choices' => array(
  143. 'field.ProductFamily.behaviorStockWeekOptions.' . ProductFamily::BEHAVIOR_STOCK_WEEK_RENEWABLE => ProductFamily::BEHAVIOR_STOCK_WEEK_RENEWABLE,
  144. 'field.ProductFamily.behaviorStockWeekOptions.' . ProductFamily::BEHAVIOR_STOCK_WEEK_RENEWABLE_VALIDATION => ProductFamily::BEHAVIOR_STOCK_WEEK_RENEWABLE_VALIDATION,
  145. 'field.ProductFamily.behaviorStockWeekOptions.' . ProductFamily::BEHAVIOR_STOCK_WEEK_NON_RENEWABLE => ProductFamily::BEHAVIOR_STOCK_WEEK_NON_RENEWABLE
  146. ),
  147. 'translation_domain' => 'lcshop',
  148. 'multiple' => false,
  149. 'expanded' => true,
  150. 'required' => true
  151. ));
  152. $formBuilder->add('behaviorExpirationDate', ChoiceType::class, array(
  153. 'choices' => array(
  154. 'field.ProductFamily.behaviorExpirationDateOptions.' . ProductFamily::BEHAVIOR_EXPIRATION_DATE_BY_PRODUCT_FAMILY => ProductFamily::BEHAVIOR_EXPIRATION_DATE_BY_PRODUCT_FAMILY,
  155. 'field.ProductFamily.behaviorExpirationDateOptions.' . ProductFamily::BEHAVIOR_EXPIRATION_DATE_BY_PRODUCT => ProductFamily::BEHAVIOR_EXPIRATION_DATE_BY_PRODUCT
  156. ),
  157. 'translation_domain' => 'lcshop',
  158. 'multiple' => false,
  159. 'expanded' => true,
  160. 'required' => false
  161. ));
  162. $formBuilder->add('products', CollectionType::class, array(
  163. 'label' => 'Déclinaisons',
  164. 'entry_type' => ProductType::class,
  165. 'entry_options' => ['label' => false],
  166. 'allow_add' => true,
  167. 'allow_delete' => true,
  168. 'required' => true
  169. )
  170. );
  171. $formBuilder = $this->overrideFormBuilder($formBuilder, $entity, $view);
  172. return $formBuilder;
  173. }
  174. public function updateProductFamilyEntity($entity, $editForm = false)
  175. {
  176. if ($editForm) {
  177. $entity = $this->productFamilyUtils->processBeforePersistProductFamily($entity, $editForm);
  178. }
  179. parent::updateEntity($entity);
  180. $this->orderUtils->updatePriceByProductFamily($entity);
  181. }
  182. public function persistProductFamilyEntity($entity, $newForm)
  183. {
  184. $entity = $this->productFamilyUtils->processBeforePersistProductFamily($entity, $newForm);
  185. $this->em->persist($entity);
  186. $this->em->flush();
  187. }
  188. protected function editAction()
  189. {
  190. $this->dispatch(EasyAdminEvents::PRE_EDIT);
  191. $id = $this->request->query->get('id');
  192. $easyadmin = $this->request->attributes->get('easyadmin');
  193. $entity = $easyadmin['item'];
  194. if ($this->request->isXmlHttpRequest() && $property = $this->request->query->get('property')) {
  195. $newValue = 'true' === mb_strtolower($this->request->query->get('newValue'));
  196. $fieldsMetadata = $this->entity['list']['fields'];
  197. if (!isset($fieldsMetadata[$property]) || 'toggle' !== $fieldsMetadata[$property]['dataType']) {
  198. throw new \RuntimeException(sprintf('The type of the "%s" property is not "toggle".', $property));
  199. }
  200. $this->updateEntityProperty($entity, $property, $newValue);
  201. $this->utils->addFlash('success', 'success.common.fieldChange');
  202. $response['flashMessages'] = $this->utils->getFlashMessages();
  203. return new Response(json_encode($response));
  204. }
  205. $fields = $this->entity['edit']['fields'];
  206. $editForm = $this->executeDynamicMethod('create<EntityName>EditForm', [$entity, $fields]);
  207. $deleteForm = $this->createDeleteForm($this->entity['name'], $id);
  208. $sortableProductsField = array();
  209. foreach ($editForm->get('products')->getData() as $k => $product) {
  210. if($product->getOriginProduct() == false) {
  211. $sortableProductsField[$product->getPosition()] = $k;
  212. }else{
  213. $sortableProductsField[-1] = $k;
  214. }
  215. }
  216. ksort($sortableProductsField);
  217. $editForm->handleRequest($this->request);
  218. if ($editForm->isSubmitted() && count($entity->getProductCategories()) == 0) {
  219. $editForm->get('productCategories')->addError(new FormError('Vous devez choisir au moins une catégorie'));
  220. }
  221. if ($editForm->isSubmitted() && $editForm->isValid() && count($entity->getProductCategories()) > 0) {
  222. $this->processUploadedFiles($editForm);
  223. $this->dispatch(EasyAdminEvents::PRE_UPDATE, ['entity' => $entity]);
  224. $this->executeDynamicMethod('update<EntityName>Entity', [$entity, $editForm]);
  225. $this->dispatch(EasyAdminEvents::POST_UPDATE, ['entity' => $entity]);
  226. $this->utils->addFlash('success', 'Produit sauvegardé');
  227. if ($editForm->get('stayOnPage')->getData() != "false" || $this->request->get('submitAndStay') !== null) {
  228. $refererUrl = $this->request->query->get('referer', '');
  229. return $this->redirectToRoute('easyadmin', ['entity' => 'ProductFamily', 'action' => 'edit', 'id' => $id, 'referer' => $refererUrl, 'ajax' => $this->request->query->get('ajax')]);
  230. } else {
  231. return $this->redirectToReferrer();
  232. }
  233. }
  234. $this->dispatch(EasyAdminEvents::POST_EDIT);
  235. $parameters = [
  236. 'form' => $editForm->createView(),
  237. 'entity_fields' => $fields,
  238. 'entity' => $entity,
  239. 'delete_form' => $deleteForm->createView(),
  240. 'sortableProductsField' => $sortableProductsField,
  241. 'productsSalesStatistic' => $this->orderUtils->getProductsSalesStatistic($entity)
  242. ];
  243. return $this->executeDynamicMethod('render<EntityName>Template', ['edit', $this->entity['templates']['edit'], $parameters]);
  244. }
  245. protected function newAction()
  246. {
  247. $this->dispatch(EasyAdminEvents::PRE_NEW);
  248. $entity = $this->executeDynamicMethod('createNew<EntityName>Entity');
  249. $easyadmin = $this->request->attributes->get('easyadmin');
  250. $easyadmin['item'] = $entity;
  251. $this->request->attributes->set('easyadmin', $easyadmin);
  252. $fields = $this->entity['new']['fields'];
  253. $newForm = $this->executeDynamicMethod('create<EntityName>NewForm', [$entity, $fields]);
  254. $newForm->handleRequest($this->request);
  255. if ($newForm->isSubmitted() && array_search(true, $newForm->get('productCategories')->getData()->toArray()) === false) {
  256. $newForm->get('productCategories')->addError(new FormError('Vous devez choisir au moins une catégorie'));
  257. }
  258. if ($newForm->isSubmitted() && $newForm->isValid() && array_search(true, $newForm->get('productCategories')->getData()->toArray()) !== false) {
  259. $this->processUploadedFiles($newForm);
  260. $this->dispatch(EasyAdminEvents::PRE_PERSIST, ['entity' => $entity]);
  261. $this->executeDynamicMethod('persist<EntityName>Entity', [$entity, $newForm]);
  262. $this->dispatch(EasyAdminEvents::POST_PERSIST, ['entity' => $entity]);
  263. if ($newForm->get('stayOnPage')->getData() != "false" || $this->request->get('submitAndStay') !== null) {
  264. return $this->redirectToRoute('easyadmin', ['entity' => 'ProductFamily', 'action' => 'edit', 'id' => $entity->getId()]);
  265. } else {
  266. return $this->redirectToReferrer();
  267. }
  268. }
  269. $this->dispatch(EasyAdminEvents::POST_NEW, [
  270. 'entity_fields' => $fields,
  271. 'form' => $newForm,
  272. 'entity' => $entity
  273. ]);
  274. $productCategoryRepository = $this->getDoctrine()->getRepository(ProductCategoryInterface::class);
  275. $categories = $productCategoryRepository->findAllParents();
  276. $parameters = [
  277. 'form' => $newForm->createView(),
  278. 'entity_fields' => $fields,
  279. 'entity' => $entity,
  280. 'categories' => $categories,
  281. 'sortableProductsField' => array(),
  282. 'productsSalesStatistic' => null
  283. ];
  284. return $this->executeDynamicMethod('render<EntityName>Template', ['new', $this->entity['templates']['new'], $parameters]);
  285. }
  286. //hack utilisé pour filter sur les catégories lors du tri des produits par sous cat
  287. //A améliorer à l'occas
  288. protected function createListQueryBuilder($entityClass, $sortDirection, $sortField = null, $dqlFilter = null)
  289. {
  290. $productCategoryId = false;
  291. if (isset($dqlFilter['productCategoryId'])) $productCategoryId = $dqlFilter['productCategoryId'];
  292. if(isset($dqlFilter['filter']))$dqlFilter = $dqlFilter['filter'];
  293. $queryBuilder = parent::createListQueryBuilder($entityClass, $sortDirection, $sortField, $dqlFilter);
  294. $queryBuilder->leftJoin('entity.productCategories', 'product_categories');
  295. if ($productCategoryId) {
  296. $queryBuilder->andWhere('product_categories.id = :cat');
  297. $queryBuilder->setParameter('cat', $productCategoryId);
  298. }
  299. return $queryBuilder;
  300. }
  301. public function sortByProductCategoryAction(){
  302. $this->dispatch(EasyAdminEvents::PRE_LIST);
  303. $entity = null;
  304. //Replace this with query builder function, do not use finAll of easyAdmin
  305. if ($this->request->query->get('productCategoryId')) {
  306. if(!is_array($this->entity['list']['dql_filter'])) {
  307. $this->entity['list']['dql_filter'] = array('filter' => $this->entity['list']['dql_filter']);
  308. }
  309. $this->entity['list']['dql_filter']['productCategoryId'] = $this->request->query->get('productCategoryId');
  310. $easyadmin = $this->request->attributes->get('easyadmin');
  311. $entity = $easyadmin['item'];
  312. }else{
  313. throw new \ErrorException('Action impossible') ;
  314. }
  315. if ($this->entity['list']['dql_filter']['filter']) $this->entity['list']['dql_filter']['filter'] .= sprintf(' AND entity.status = 1');
  316. else $this->entity['list']['dql_filter']['filter'] .= sprintf(' entity.status = 1');
  317. $fields = $this->entity['list']['fields'];
  318. $paginator = $this->findAll($this->entity['class'], $this->request->query->get('page', 1), 500, 'position', 'asc', $this->entity['list']['dql_filter']);
  319. $this->dispatch(EasyAdminEvents::POST_LIST, ['paginator' => $paginator]);
  320. $positionForm = $this->createFormBuilder(array('entities', $paginator->getCurrentPageResults()))
  321. ->add('entities', CollectionType::class, array(
  322. 'required' => true,
  323. 'allow_add' => true,
  324. 'entry_type' => AbstractEditPositionType::class,
  325. ))
  326. ->getForm();
  327. $positionForm->handleRequest($this->request);
  328. if ($positionForm->isSubmitted() && $positionForm->isValid()) {
  329. $class = $this->entity['class'];
  330. $repo = $this->em->getRepository($class);
  331. $latsPos = 0;
  332. foreach ($positionForm->get('entities')->getData() as $elm) {
  333. $this->dispatch(EasyAdminEvents::PRE_UPDATE, ['entity' => $entity]);
  334. $entity = $repo->find($elm['id']);
  335. $entity->setPosition($elm['position']);
  336. $this->em->persist($entity);
  337. $this->dispatch(EasyAdminEvents::POST_UPDATE, ['entity' => $entity]);
  338. $latsPos = $elm['position'];
  339. }
  340. //die();
  341. //to do récupérer les élements hors ligne et incrémenter position
  342. /*foreach ($repo->findBy(array('status'=> false)) as $offlineEntity) {
  343. $latsPos++;
  344. $offlineEntity->setPosition($latsPos);
  345. $this->em->persist($offlineEntity);
  346. }*/
  347. $this->em->flush();
  348. $this->addFlash('success', 'Position modifié', array(), 'mweb');
  349. return $this->redirectToReferrer();
  350. }
  351. $parameters = [
  352. 'paginator' => $paginator,
  353. 'fields' => $fields,
  354. 'batch_form' => $this->createBatchForm($this->entity['name'])->createView(),
  355. 'delete_form_template' => $this->createDeleteForm($this->entity['name'], '__id__')->createView(),
  356. 'postion_form' => $positionForm->createView(),
  357. 'entity' => $entity,
  358. 'sortable' => true
  359. ];
  360. return $this->executeDynamicMethod('render<EntityName>Template', ['sortable', "@LcShop/backend/default/sortable.html.twig", $parameters]);
  361. }
  362. }