I have a file and I know there is a media that references it. How can I get this media?
In the opposite direction, knowing the media id, I can get the file:
$media = Media::load($mid); $fid = $media->field_media_image->target_id; $file = File::load($fid);
But now I know the file id and I want the media. How can I get it?