Multiple fields at same time
Obtain multiple fields at the same time and rename the path with a custom name
$nodeValues = using($node)->values([
'time' => 'field_date_date_time_single',
'media_names'=> 'field_media_multi',
'id' => 'nid',
'title_node' => 'title',
]);
Result:
^ Drupal\fluent\Collection {#1533 ▼
#items: array:4 [▼
"time" => Drupal\Core\Datetime\DrupalDateTime {#1372 ▶}
"media_names" => array:3 [▶]
"id" => 1
"title_node" => "title Boolean"
]
#escapeWhenCastingToString: false
}