Bundle/MediaBundle/Helper/MediaManager.php
public function getHandlerForType($type)
    {
        foreach ($this->handlers as $handler) {
            if ($handler->getType() == $type) {
                return $handler;
            }
        }

        return new FileHandler();
    }
public function getHandlerForType($type)
    {
        foreach ($this->handlers as $handler) {
            if ($handler->getType() == $type) {
                return $handler;
            }
        }

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

@param string $type

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