Bundle/WidgetMapBundle/Entity/WidgetMap.php
public function getSubstituteForView(View $view)
    {
        foreach ($this->getContextualSubstitutes() as $substitute) {
            if ($substitute->getView() === $view) {
                return $substitute;
            }

            while ($template = $view->getTemplate()) {
                if ($substitute->getView() === $template) {
                    return $substitute;
                }
            }
        }
    }
public function getSubstituteForView(View $view)
    {
        foreach ($this->getContextualSubstitutes() as $substitute) {
            if ($substitute->getView() === $view) {
                return $substitute;
            }

            while ($template = $view->getTemplate()) {
                if ($substitute->getView() === $template) {
                    return $substitute;
                }
            }
        }
    }
public function getSubstituteForView ( View $ view ) { foreach ( $ this -> getContextualSubstitutes ( ) as $ substitute ) { if ( $ substitute -> getView ( ) === $ view ) { return $ substitute ; } while ( $ template = $ view -> getTemplate ( ) ) { if ( $ substitute -> getView ( ) === $ template ) { return $ substitute ; } } } }
Return substitute if used in View or in one of its inherited Template.

@return WidgetMap|null
Return substitute if used in View or in one of its inherited Template .