Guest User

Untitled

a guest
Oct 22nd, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. public function render(ResultRow $values) {
  2. //
  3. // Complex query omitted
  4. //
  5. $results = $query->execute()->fetchAll();
  6. $html = '';
  7.  
  8. foreach ($results as $item) {
  9. $customerLink = Drupal::service('path.alias_manager')->getAliasByPath('/node/' . $item->customer_nid);
  10. $scLink = Drupal::service('path.alias_manager')->getAliasByPath('/node/' . $item->sc_nid);
  11.  
  12. $render = array(
  13. '#theme' => 'my_field_shipment_customers',
  14. '#customer_link' => $customerLink,
  15. '#customer' => $item->customer,
  16. '#sc_link' => $scLink,
  17. '#sc_id' => $item->sc_id,
  18. '#containers' => $item->containers,
  19. );
  20.  
  21. $html .= Drupal::service('renderer')->render($render);
  22. }
  23.  
  24. $render = array(
  25. '#theme' => 'my_field_shipment_customers_wrapper',
  26. '#data' => t($html),
  27. );
  28.  
  29. $output = Drupal::service('renderer')->render($render);
  30.  
  31. return $output;
  32. }
  33.  
  34. $values->{'my_field_outstanding_balance'} = $balance;
Add Comment
Please, Sign In to add comment