@@ 144-154 (lines=11) @@ | ||
141 | } |
|
142 | ||
143 | /** @var \Eccube\Entity\Shipping $Shipping */ |
|
144 | foreach ($Shippings as $Shipping) { |
|
145 | $shipmentItems = $Shipping->getShipmentItems(); |
|
146 | /** @var \Eccube\Entity\ShipmentItem $ShipmentItem */ |
|
147 | foreach ($shipmentItems as $ShipmentItem) { |
|
148 | $ShipmentItem->setOrder($TargetOrder); |
|
149 | $ShipmentItem->setShipping($Shipping); |
|
150 | $app['orm.em']->persist($ShipmentItem); |
|
151 | } |
|
152 | $Shipping->setOrder($TargetOrder); |
|
153 | $app['orm.em']->persist($Shipping); |
|
154 | } |
|
155 | } else { |
|
156 | ||
157 | $NewShipmentItems = new ArrayCollection(); |
|
@@ 181-191 (lines=11) @@ | ||
178 | } |
|
179 | // 配送商品の更新. delete/insert. |
|
180 | $Shippings = $TargetOrder->getShippings(); |
|
181 | foreach ($Shippings as $Shipping) { |
|
182 | $ShipmentItems = $Shipping->getShipmentItems(); |
|
183 | foreach ($ShipmentItems as $ShipmentItem) { |
|
184 | $app['orm.em']->remove($ShipmentItem); |
|
185 | } |
|
186 | $ShipmentItems->clear(); |
|
187 | foreach ($NewShipmentItems as $NewShipmentItem) { |
|
188 | $NewShipmentItem->setShipping($Shipping); |
|
189 | $ShipmentItems->add($NewShipmentItem); |
|
190 | } |
|
191 | } |
|
192 | } |
|
193 | ||
194 | $app['orm.em']->persist($TargetOrder); |