src/Sulu/Bundle/MediaBundle/Media/FormatOptions/FormatOptionsManager.php
private function getFileVersionForMedia(MediaInterface $media)
    {
        /** @var File $file */
        $file = $media->getFiles()->get(0);
        if (!isset($file)) {
            throw new FileVersionNotFoundException($media->getId(), 'latest');
        }

        $fileVersion = $file->getLatestFileVersion();
        if (!isset($fileVersion)) {
            throw new FileVersionNotFoundException($media->getId(), 'latest');
        }

        return $fileVersion;
    }
private function getFileVersionForMedia(MediaInterface $media)
    {
        /** @var File $file */
        $file = $media->getFiles()->get(0);
        if (!isset($file)) {
            throw new FileVersionNotFoundException($media->getId(), 'latest');
        }

        $fileVersion = $file->getLatestFileVersion();
        if (!isset($fileVersion)) {
            throw new FileVersionNotFoundException($media->getId(), 'latest');
        }

        return $fileVersion;
    }
private function getFileVersionForMedia ( MediaInterface $ media ) { /** @var File $file */ $ file = $ media -> getFiles ( ) -> get ( 0 ) ; if ( ! isset ( $ file ) ) { throw new FileVersionNotFoundException ( $ media -> getId ( ) , 'latest' ) ; } $ fileVersion = $ file -> getLatestFileVersion ( ) ; if ( ! isset ( $ fileVersion ) ) { throw new FileVersionNotFoundException ( $ media -> getId ( ) , 'latest' ) ; } return $ fileVersion ; }
Gets the latest file-version of a given media.

@param MediaInterface $media

@throws FileVersionNotFoundException

@return FileVersion
Gets the latest file - version of a given media .