src/Sulu/Bundle/MediaBundle/Media/FormatCache/LocalFormatCache.php
protected function getIdFromUrl($url)
    {
        $fileName = basename($url);
        $idParts = explode('-', $fileName);

        if (count($idParts) < 2) {
            throw new ImageProxyInvalidUrl('No `id` was found in the url');
        }

        $id = $idParts[0];

        if (preg_match('/[^0-9]/', $id)) {
            throw new ImageProxyInvalidUrl('The founded `id` was not a valid integer');
        }

        return $id;
    }
protected function getIdFromUrl($url)
    {
        $fileName = basename($url);
        $idParts = explode('-', $fileName);

        if (count($idParts) < 2) {
            throw new ImageProxyInvalidUrl('No `id` was found in the url');
        }

        $id = $idParts[0];

        if (preg_match('/[^0-9]/', $id)) {
            throw new ImageProxyInvalidUrl('The founded `id` was not a valid integer');
        }

        return $id;
    }
protected function getIdFromUrl ( $ url ) { $ fileName = basename ( $ url ) ; $ idParts = explode ( '-' , $ fileName ) ; if ( count ( $ idParts ) < 2 ) { throw new ImageProxyInvalidUrl ( 'No `id` was found in the url' ) ; } $ id = $ idParts [ 0 ] ; if ( preg_match ( '/[^0-9]/' , $ id ) ) { throw new ImageProxyInvalidUrl ( 'The founded `id` was not a valid integer' ) ; } return $ id ; }
return the id of by a given url.

@param string $url

@return int

@throws \Sulu\Bundle\MediaBundle\Media\Exception\ImageProxyInvalidUrl
return the id of by a given url .