diff --git a/src/Eccube/Command/GenerateDummyDataCommand.php b/src/Eccube/Command/GenerateDummyDataCommand.php index 0cf6fc239c4..a8974749705 100644 --- a/src/Eccube/Command/GenerateDummyDataCommand.php +++ b/src/Eccube/Command/GenerateDummyDataCommand.php @@ -181,7 +181,7 @@ protected function execute(InputInterface $input, OutputInterface $output) $output->writeln('Order: id='.$Order->getId()); break; } - $this->entityManager->flush($Order); + $this->entityManager->flush(); $j++; if ($output->getVerbosity() >= OutputInterface::VERBOSITY_NORMAL && ($j % 100) === 0 && $j > 0) { $output->writeln(' ...'.$j); diff --git a/src/Eccube/Command/PluginGenerateCommand.php b/src/Eccube/Command/PluginGenerateCommand.php index 0e199211e4e..d78269336d3 100644 --- a/src/Eccube/Command/PluginGenerateCommand.php +++ b/src/Eccube/Command/PluginGenerateCommand.php @@ -373,7 +373,7 @@ public function index(Request \$request) if (\$form->isSubmitted() && \$form->isValid()) { \$Config = \$form->getData(); \$this->entityManager->persist(\$Config); - \$this->entityManager->flush(\$Config); + \$this->entityManager->flush(); \$this->addSuccess('登録しました。', 'admin'); return \$this->redirectToRoute('${snakecased}_admin_config'); diff --git a/src/Eccube/Controller/Admin/Content/LayoutController.php b/src/Eccube/Controller/Admin/Content/LayoutController.php index c5b34f0660e..33d07030ae0 100644 --- a/src/Eccube/Controller/Admin/Content/LayoutController.php +++ b/src/Eccube/Controller/Admin/Content/LayoutController.php @@ -137,7 +137,7 @@ public function delete(Layout $Layout, CacheUtil $cacheUtil) } $this->entityManager->remove($Layout); - $this->entityManager->flush($Layout); + $this->entityManager->flush(); $this->addSuccess('admin.common.delete_complete', 'admin'); @@ -180,7 +180,7 @@ public function edit(Request $request, $id = null, $previewPageId = null, CacheU // Layoutの更新 $Layout = $form->getData(); $this->entityManager->persist($Layout); - $this->entityManager->flush($Layout); + $this->entityManager->flush(); // BlockPositionの更新 // delete/insertのため、一度削除する. @@ -188,7 +188,7 @@ public function edit(Request $request, $id = null, $previewPageId = null, CacheU foreach ($BlockPositions as $BlockPosition) { $Layout->removeBlockPosition($BlockPosition); $this->entityManager->remove($BlockPosition); - $this->entityManager->flush($BlockPosition); + $this->entityManager->flush(); } // ブロックの個数分登録を行う. diff --git a/src/Eccube/Controller/Admin/Content/PageController.php b/src/Eccube/Controller/Admin/Content/PageController.php index 48d7607feb9..1a4fa72c792 100644 --- a/src/Eccube/Controller/Admin/Content/PageController.php +++ b/src/Eccube/Controller/Admin/Content/PageController.php @@ -179,7 +179,7 @@ public function edit(Request $request, $id = null, Environment $twig, RouterInte foreach ($Page->getPageLayouts() as $PageLayout) { $Page->removePageLayout($PageLayout); $this->entityManager->remove($PageLayout); - $this->entityManager->flush($PageLayout); + $this->entityManager->flush(); } $Layout = $form['PcLayout']->getData(); @@ -195,7 +195,7 @@ public function edit(Request $request, $id = null, Environment $twig, RouterInte $PageLayout->setPage($Page); $this->entityManager->persist($PageLayout); - $this->entityManager->flush($PageLayout); + $this->entityManager->flush(); } $Layout = $form['SpLayout']->getData(); @@ -208,7 +208,7 @@ public function edit(Request $request, $id = null, Environment $twig, RouterInte $PageLayout->setPage($Page); $this->entityManager->persist($PageLayout); - $this->entityManager->flush($PageLayout); + $this->entityManager->flush(); } $event = new EventArgs( diff --git a/src/Eccube/Controller/Admin/Customer/CustomerController.php b/src/Eccube/Controller/Admin/Customer/CustomerController.php index 880d3c80c49..9bb70b63059 100644 --- a/src/Eccube/Controller/Admin/Customer/CustomerController.php +++ b/src/Eccube/Controller/Admin/Customer/CustomerController.php @@ -242,7 +242,7 @@ public function delete(Request $request, $id, TranslatorInterface $translator) try { $this->entityManager->remove($Customer); - $this->entityManager->flush($Customer); + $this->entityManager->flush(); $this->addSuccess('admin.common.delete_complete', 'admin'); } catch (ForeignKeyConstraintViolationException $e) { log_error('会員削除失敗', [$e]); diff --git a/src/Eccube/Controller/Admin/Order/EditController.php b/src/Eccube/Controller/Admin/Order/EditController.php index 2cfe72d402f..a844923d2cf 100644 --- a/src/Eccube/Controller/Admin/Order/EditController.php +++ b/src/Eccube/Controller/Admin/Order/EditController.php @@ -306,7 +306,7 @@ public function index(Request $request, $id = null, RouterInterface $router) // 会員の場合、購入回数、購入金額などを更新 if ($Customer = $TargetOrder->getCustomer()) { $this->orderRepository->updateOrderSummary($Customer); - $this->entityManager->flush($Customer); + $this->entityManager->flush(); } $event = new EventArgs( diff --git a/src/Eccube/Controller/Admin/Order/MailController.php b/src/Eccube/Controller/Admin/Order/MailController.php index ffde1c588ea..b7c8638f017 100644 --- a/src/Eccube/Controller/Admin/Order/MailController.php +++ b/src/Eccube/Controller/Admin/Order/MailController.php @@ -165,7 +165,7 @@ public function index(Request $request, Order $Order) ->setOrder($Order); $this->entityManager->persist($MailHistory); - $this->entityManager->flush($MailHistory); + $this->entityManager->flush(); $event = new EventArgs( [ diff --git a/src/Eccube/Controller/Admin/Order/OrderController.php b/src/Eccube/Controller/Admin/Order/OrderController.php index 1f99efe1bce..dc8899b1590 100644 --- a/src/Eccube/Controller/Admin/Order/OrderController.php +++ b/src/Eccube/Controller/Admin/Order/OrderController.php @@ -517,19 +517,23 @@ public function updateOrderStatus(Request $request, Shipping $Shipping) foreach ($Order->getOrderItems() as $OrderItem) { $ProductClass = $OrderItem->getProductClass(); if ($OrderItem->isProduct() && !$ProductClass->isStockUnlimited()) { - $this->entityManager->flush($ProductClass); + $this->entityManager->persist($ProductClass); + $this->entityManager->flush(); $ProductStock = $this->productStockRepository->findOneBy(['ProductClass' => $ProductClass]); - $this->entityManager->flush($ProductStock); + $this->entityManager->persist($ProductStock); + $this->entityManager->flush(); } } } - $this->entityManager->flush($Order); - $this->entityManager->flush($Shipping); + $this->entityManager->persist($Order); + $this->entityManager->persist($Shipping); + $this->entityManager->flush(); // 会員の場合、購入回数、購入金額などを更新 if ($Customer = $Order->getCustomer()) { $this->orderRepository->updateOrderSummary($Customer); - $this->entityManager->flush($Customer); + $this->entityManager->persist($Customer); + $this->entityManager->flush(); } } else { $from = $Order->getOrderStatus()->getName(); @@ -593,7 +597,8 @@ public function updateTrackingNumber(Request $request, Shipping $shipping) try { $shipping->setTrackingNumber($trackingNumber); - $this->entityManager->flush($shipping); + $this->entityManager->persist($shipping); + $this->entityManager->flush(); log_info('送り状番号変更処理完了', [$shipping->getId()]); $message = ['status' => 'OK', 'shipping_id' => $shipping->getId(), 'tracking_number' => $trackingNumber]; diff --git a/src/Eccube/Controller/ShippingMultipleController.php b/src/Eccube/Controller/ShippingMultipleController.php index 2044f86a47d..e009468ad10 100644 --- a/src/Eccube/Controller/ShippingMultipleController.php +++ b/src/Eccube/Controller/ShippingMultipleController.php @@ -417,7 +417,7 @@ public function shippingMultipleEdit(Request $request) $CustomerAddress->setCustomer($Customer); $this->entityManager->persist($CustomerAddress); - $this->entityManager->flush($CustomerAddress); + $this->entityManager->flush(); } else { // 非会員用のセッションに追加 $CustomerAddresses = $this->session->get(OrderHelper::SESSION_NON_MEMBER_ADDRESSES); diff --git a/src/Eccube/Repository/BlockPositionRepository.php b/src/Eccube/Repository/BlockPositionRepository.php index 6d099ea56c9..b1be500d190 100644 --- a/src/Eccube/Repository/BlockPositionRepository.php +++ b/src/Eccube/Repository/BlockPositionRepository.php @@ -74,7 +74,7 @@ public function register($data, $Blocks, $UnusedBlocks, $Layout) ->setLayout($Layout); $Layout->addBlockPosition($BlockPosition); $em->persist($BlockPosition); - $em->flush($BlockPosition); + $em->flush(); } } } diff --git a/src/Eccube/Repository/CategoryRepository.php b/src/Eccube/Repository/CategoryRepository.php index ef3303b75db..2c90a021562 100644 --- a/src/Eccube/Repository/CategoryRepository.php +++ b/src/Eccube/Repository/CategoryRepository.php @@ -136,7 +136,7 @@ public function save($Category) $em = $this->getEntityManager(); $em->persist($Category); - $em->flush($Category); + $em->flush(); } /** @@ -160,6 +160,6 @@ public function delete($Category) $em = $this->getEntityManager(); $em->remove($Category); - $em->flush($Category); + $em->flush(); } } diff --git a/src/Eccube/Repository/ClassCategoryRepository.php b/src/Eccube/Repository/ClassCategoryRepository.php index 22aa659a863..8f08c2b9b2d 100644 --- a/src/Eccube/Repository/ClassCategoryRepository.php +++ b/src/Eccube/Repository/ClassCategoryRepository.php @@ -79,7 +79,7 @@ public function save($ClassCategory) $em = $this->getEntityManager(); $em->persist($ClassCategory); - $em->flush($ClassCategory); + $em->flush(); } /** @@ -103,7 +103,7 @@ public function delete($ClassCategory) $em = $this->getEntityManager(); $em->remove($ClassCategory); - $em->flush($ClassCategory); + $em->flush(); } /** @@ -121,6 +121,6 @@ public function toggleVisibility($ClassCategory) $em = $this->getEntityManager(); $em->persist($ClassCategory); - $em->flush($ClassCategory); + $em->flush(); } } diff --git a/src/Eccube/Repository/ClassNameRepository.php b/src/Eccube/Repository/ClassNameRepository.php index a7c9bfd6058..7e894b0585f 100644 --- a/src/Eccube/Repository/ClassNameRepository.php +++ b/src/Eccube/Repository/ClassNameRepository.php @@ -68,7 +68,7 @@ public function save($ClassName) $em = $this->getEntityManager(); $em->persist($ClassName); - $em->flush([$ClassName]); + $em->flush(); } /** @@ -92,6 +92,6 @@ public function delete($ClassName) $em = $this->getEntityManager(); $em->remove($ClassName); - $em->flush($ClassName); + $em->flush(); } } diff --git a/src/Eccube/Repository/CustomerAddressRepository.php b/src/Eccube/Repository/CustomerAddressRepository.php index d5cc7aaf3e8..db6ea9bfe34 100644 --- a/src/Eccube/Repository/CustomerAddressRepository.php +++ b/src/Eccube/Repository/CustomerAddressRepository.php @@ -43,6 +43,6 @@ public function delete($CustomerAddress) { $em = $this->getEntityManager(); $em->remove($CustomerAddress); - $em->flush($CustomerAddress); + $em->flush(); } } diff --git a/src/Eccube/Repository/CustomerFavoriteProductRepository.php b/src/Eccube/Repository/CustomerFavoriteProductRepository.php index ae0d28d4b85..24430036a42 100644 --- a/src/Eccube/Repository/CustomerFavoriteProductRepository.php +++ b/src/Eccube/Repository/CustomerFavoriteProductRepository.php @@ -99,6 +99,6 @@ public function delete($CustomerFavoriteProduct) { $em = $this->getEntityManager(); $em->remove($CustomerFavoriteProduct); - $em->flush($CustomerFavoriteProduct); + $em->flush(); } } diff --git a/src/Eccube/Repository/MemberRepository.php b/src/Eccube/Repository/MemberRepository.php index 6c0ff2f1242..1e6f9ba704e 100644 --- a/src/Eccube/Repository/MemberRepository.php +++ b/src/Eccube/Repository/MemberRepository.php @@ -51,7 +51,9 @@ public function up(Member $Member) $Member2->setSortNo($sortNo); $em = $this->getEntityManager(); - $em->flush([$Member, $Member2]); + $em->persist($Member); + $em->persist($Member2); + $em->flush(); } /** @@ -74,7 +76,9 @@ public function down(Member $Member) $Member2->setSortNo($sortNo); $em = $this->getEntityManager(); - $em->flush([$Member, $Member2]); + $em->persist($Member); + $em->persist($Member2); + $em->flush(); } /** @@ -95,7 +99,7 @@ public function save($Member) $em = $this->getEntityManager(); $em->persist($Member); - $em->flush($Member); + $em->flush(); } /** @@ -118,6 +122,6 @@ public function delete($Member) $em = $this->getEntityManager(); $em->remove($Member); - $em->flush($Member); + $em->flush(); } } diff --git a/src/Eccube/Repository/NewsRepository.php b/src/Eccube/Repository/NewsRepository.php index 14aecaeca02..969b16f0587 100644 --- a/src/Eccube/Repository/NewsRepository.php +++ b/src/Eccube/Repository/NewsRepository.php @@ -42,7 +42,7 @@ public function save($News) { $em = $this->getEntityManager(); $em->persist($News); - $em->flush($News); + $em->flush(); } /** @@ -57,7 +57,7 @@ public function delete($News) { $em = $this->getEntityManager(); $em->remove($News); - $em->flush($News); + $em->flush(); } /** diff --git a/src/Eccube/Repository/OrderPdfRepository.php b/src/Eccube/Repository/OrderPdfRepository.php index aa6f69a4436..ee9c80bcfa9 100644 --- a/src/Eccube/Repository/OrderPdfRepository.php +++ b/src/Eccube/Repository/OrderPdfRepository.php @@ -59,7 +59,7 @@ public function save($arrData) ->setNote3($arrData['note3']) ->setVisible(true); $this->getEntityManager()->persist($OrderPdf); - $this->getEntityManager()->flush($OrderPdf); + $this->getEntityManager()->flush(); return true; } diff --git a/src/Eccube/Repository/TagRepository.php b/src/Eccube/Repository/TagRepository.php index 740027c4eb6..2d7536dded1 100644 --- a/src/Eccube/Repository/TagRepository.php +++ b/src/Eccube/Repository/TagRepository.php @@ -48,7 +48,7 @@ public function save($tag) $em = $this->getEntityManager(); $em->persist($tag); - $em->flush($tag); + $em->flush(); } /** @@ -85,7 +85,7 @@ public function delete($Tag) ->execute(); $em->remove($Tag); - $em->flush($Tag); + $em->flush(); $em->commit(); } diff --git a/src/Eccube/Service/CartService.php b/src/Eccube/Service/CartService.php index 1085f4e9cf1..ae79b6c2480 100644 --- a/src/Eccube/Service/CartService.php +++ b/src/Eccube/Service/CartService.php @@ -134,7 +134,7 @@ public function getCarts($empty_delete = false) $cartKeys[] = $Cart->getCartKey(); } else { $this->entityManager->remove($this->carts[$index]); - $this->entityManager->flush($this->carts[$index]); + $this->entityManager->flush(); unset($this->carts[$index]); } } @@ -281,10 +281,10 @@ protected function restoreCarts($cartItems) foreach ($this->getCarts() as $Cart) { foreach ($Cart->getCartItems() as $i) { $this->entityManager->remove($i); - $this->entityManager->flush($i); + $this->entityManager->flush(); } $this->entityManager->remove($Cart); - $this->entityManager->flush($Cart); + $this->entityManager->flush(); } $this->carts = []; @@ -305,10 +305,10 @@ protected function restoreCarts($cartItems) if ($Cart) { foreach ($Cart->getCartItems() as $i) { $this->entityManager->remove($i); - $this->entityManager->flush($i); + $this->entityManager->flush(); } $this->entityManager->remove($Cart); - $this->entityManager->flush($Cart); + $this->entityManager->flush(); } $Cart = new Cart(); $Cart->setCartKey($cartKey); @@ -400,9 +400,10 @@ public function save() $this->entityManager->persist($Cart); foreach ($Cart->getCartItems() as $item) { $this->entityManager->persist($item); - $this->entityManager->flush($item); + $this->entityManager->flush(); } - $this->entityManager->flush($Cart); + $this->entityManager->persist($Cart); + $this->entityManager->flush(); $cartKeys[] = $Cart->getCartKey(); } @@ -446,7 +447,7 @@ public function clear() $removed = $this->getCart(); if ($removed && UnitOfWork::STATE_MANAGED === $this->entityManager->getUnitOfWork()->getEntityState($removed)) { $this->entityManager->remove($removed); - $this->entityManager->flush($removed); + $this->entityManager->flush(); $cartKeys = []; foreach ($Carts as $key => $Cart) { diff --git a/src/Eccube/Service/PluginService.php b/src/Eccube/Service/PluginService.php index e5778200ab2..9d979e67f5c 100644 --- a/src/Eccube/Service/PluginService.php +++ b/src/Eccube/Service/PluginService.php @@ -540,7 +540,7 @@ public function registerPlugin($meta, $source = 0) ->setCode($meta['code']); $this->entityManager->persist($p); - $this->entityManager->flush($p); + $this->entityManager->flush(); $this->pluginApiService->pluginInstalled($p); } catch (\Exception $e) {