Access entity reference in Block Plugin I have a content type that has an entity reference field. It's a content type for news articles with a field for tagging the article with taxonomy terms. 

I'm attempting to access these terms in a block plugin, however I'm having difficulty. Getting other fields like text fields, and dates work just fine. For example 

    $node = \Drupal::routeMatch()-&gt;getParameter('node');
    $node-&gt;get('body')-&gt;value


Successfully returns the contents of the node's body
 but when I use:

    $node = \Drupal::routeMatch()-&gt;getParameter('node');
    $tags = $node-&gt;get('field_tags')-&gt;value;


$tags comes up empty. 

 die(print_r($tags));


Does not display anything.
I know it's in there somewhere though because when I use

die(print_r($node));


I do see the tag id's in there.

Is there a way to display the value of an entity reference field for taxonomy terms, in a block plugin?
I found that in order to get the values I had to use getValue() instead of ->value like so:

$tags = $node-&gt;get('field_tags')-&gt;getValue();