Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
PlaceOrderDefault.php
Go to the documentation of this file.
1 <?php
6 declare(strict_types=1);
7 
9 
11 
16 {
20  private $orderManagement;
21 
25  public function __construct(
26  OrderManagementInterface $orderManagement
27  ) {
28  $this->orderManagement = $orderManagement;
29  }
30 
34  public function place(array $orderList): array
35  {
36  $errorList = [];
37  foreach ($orderList as $order) {
38  try {
39  $this->orderManagement->place($order);
40  } catch (\Exception $e) {
41  $incrementId = $order->getIncrementId();
42  $errorList[$incrementId] = $e;
43  }
44  }
45 
46  return $errorList;
47  }
48 }
$order
Definition: order.php:55
$orderManagement
Definition: case.php:14