My view returns the order entites, as shown below:
I’m trying to use this "entity" to load some fields, but none of the entity funtions to get the values works (only $row->order_id retuns value). I can load the order again using the order ID, however I’m not sure if this is neccessary.
*/ public function render() { $rows = []; foreach ($this->view->result as $row_index => $row) { $order = Drupal::entityTypeManager()->getStorage('commerce_order')->load($row->order_id);
Can we optimise it?