src/Kunstmaan/MediaBundle/Helper/MediaManager.php
public function getHandler($media)
    {
        $bestHandler = $this->defaultHandler;
        foreach ($this->handlers as $handler) {
            if ($handler->canHandle($media) && $handler->getPriority() > $bestHandler->getPriority()) {
                $bestHandler = $handler;
            }
        }

        return $bestHandler;
    }
public function getHandler($media)
    {
        $bestHandler = $this->defaultHandler;
        foreach ($this->handlers as $handler) {
            if ($handler->canHandle($media) && $handler->getPriority() > $bestHandler->getPriority()) {
                $bestHandler = $handler;
            }
        }

        return $bestHandler;
    }
public function getHandler ( $ media ) { $ bestHandler = $ this -> defaultHandler ; foreach ( $ this -> handlers as $ handler ) { if ( $ handler -> canHandle ( $ media ) && $ handler -> getPriority ( ) > $ bestHandler -> getPriority ( ) ) { $ bestHandler = $ handler ; } } return $ bestHandler ; }
Returns handler with the highest priority to handle the Media item which can handle the item. If no handler is found, it returns FileHandler

@param Media|File $media

@return AbstractMediaHandler
Returns handler with the highest priority to handle the Media item which can handle the item . If no handler is found it returns FileHandler