modules/acm_customer/src/Plugin/CustomerForm/Orders.php
public function buildSummary(array $orders = []) {
    if (empty($orders)) {
      return [
        '#markup' => $this->t('You have no orders'),
      ];
    }

    $build = [];

    foreach ($orders as $order) {
      $build[] = [
        '#theme' => 'user_order',
        '#order' => $order,
        '#order_details_path' => Url::fromRoute('acm_customer.view_page', [
          'page' => $this->getPageId(),
          'action' => 'edit',
          'id' => $order['order_id'],
        ])->toString(),
      ];
    }

    return $build;
  }
public function buildSummary(array $orders = []) {
    if (empty($orders)) {
      return [
        '#markup' => $this->t('You have no orders'),
      ];
    }

    $build = [];

    foreach ($orders as $order) {
      $build[] = [
        '#theme' => 'user_order',
        '#order' => $order,
        '#order_details_path' => Url::fromRoute('acm_customer.view_page', [
          'page' => $this->getPageId(),
          'action' => 'edit',
          'id' => $order['order_id'],
        ])->toString(),
      ];
    }

    return $build;
  }
public function buildSummary ( array $ orders = [ ] ) { if ( empty ( $ orders ) ) { return [ '#markup' => $ this -> t ( 'You have no orders' ) , ] ; } $ build = [ ] ; foreach ( $ orders as $ order ) { $ build [ ] = [ '#theme' => 'user_order' , '#order' => $ order , '#order_details_path' => Url :: fromRoute ( 'acm_customer.view_page' , [ 'page' => $ this -> getPageId ( ) , 'action' => 'edit' , 'id' => $ order [ 'order_id' ] , ] ) -> toString ( ) , ] ; } return $ build ; }
Builds a summary of orders.

@param array $orders
The orders to build a summary for.

@return array
An render array.
Builds a summary of orders .