When should I use methods, get() and magic offset There are three different ways to get an entity value, for example the node content type.


$node-&gt;type-&gt;value
$node-&gt;getType()
$node-&gt;get('type')


Which one should I use?
If there is a specific method - as for $node-&gt;getType() - I'd recommend using this one. Obviously that's never the case for dynamic stuff like fields - for that $node-&gt;type-&gt;value would be the recommendation.

Edit: $node-&gt;get('type') is just a more verbose variant of $node-&gt;type - both get you the "type" field object.