When you have to modify the values of the fields by code, there are several ways to do it. The most typical one: $entity->field_name->value = 'foo' $entity->field_name->target_id = 123 but it is the same as doing: $entity->field_name = 'foo' $entity->field_name = 123 That's a shorter way to write the same...
Oct