How to get bundle label from entity How do I get the human-readable label of a bundle from a loaded entity.

Lets say I want to get the label of a node of bundle my_article which is "My awesome article"

// Load a node
$node = Drupal::entityManager()-&gt;getStorage('node')-&gt;load(4);

print $node-&gt;bundle(); // prints the machine-readable name. e.g. 'my_article'.

print $node-&gt;getEntityType()-&gt;getBundleLabel(); // prints 'content type'.


I am only able to get the machine-readable name of the bundle or the Label of entity ("content type", "taxonomy term", etc), but how do I get the Label of the bundle?

P.S. I would prefer it to not use deprecated classes/functions
I can't see anything direct, loading the node type entity itself is an option though:

$bundle_label = \Drupal::entityTypeManager()
  -&gt;getStorage('node_type')
  -&gt;load($node-&gt;bundle())
  -&gt;label();


Or as Berdir pointed out in the comments, there's a quicker way through the entity reference field:

$bundle_label = $node-&gt;type-&gt;entity-&gt;label();