I have created class content type and set Allowed number of values to unlimited" to "Division" field Now I want to get "Division" field values programmatically in node presave hook I'm using below code.
function example_node_presave(Drupal\Core\Entity\EntityInterface $node){
if($node->bundle() == "class") {
$getDivison = $node->get('field_class_division')->target_id;
}
}