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

        return $bestHandler;
    }
public function getHandlerForType($type)
    {
        $bestHandler = $this->defaultHandler;
        foreach ($this->handlers as $handler) {
            if ($handler->getType() == $type && $handler->getPriority() > $bestHandler->getPriority()) {
                $bestHandler = $handler;
            }
        }

        return $bestHandler;
    }
public function getHandlerForType ( $ type ) { $ bestHandler = $ this -> defaultHandler ; foreach ( $ this -> handlers as $ handler ) { if ( $ handler -> getType ( ) == $ type && $ handler -> getPriority ( ) > $ bestHandler -> getPriority ( ) ) { $ bestHandler = $ handler ; } } return $ bestHandler ; }
Returns handler with the highest priority to handle the Media item based on the Type. If no handler is found, it returns FileHandler

@param string $type

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