Get Drupal 8 Media Entity Object from ID

 

This is pretty simple, but it took me a minute, because I kept trying to use the base Entity class, like an angry baby trying to remove a clenched fist from a bottle.

use Drupal\media_entity\entity\Media;
Media::load($media_id);

About the Author

Hi. My name is Jeremiah John. I'm a sf/f writer and activist.

I just completed a dystopian science fiction novel. I run a website which I created that connects farms with churches, mosques, and synagogues to buy fresh vegetables directly and distribute them on a sliding scale to those in need.

In 2003, I spent six months in prison for civil disobedience while working to close the School of the Americas, converting to Christianity, as one does, while I was in the clink.