Bundle/MediaBundle/Helper/MediaManager.php
public function getHandler($media)
    {
        foreach ($this->handlers as $handler) {
            if ($handler->canHandle($media)) {
                return $handler;
            }
        }

        return new FileHandler();
    }
public function getHandler($media)
    {
        foreach ($this->handlers as $handler) {
            if ($handler->canHandle($media)) {
                return $handler;
            }
        }

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

@param Media $media

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