public static function getParent(BlockView $view, $type)
    {
        $parent = null;

        if (null !== $view->parent) {
            if (static::isType($view->parent, $type)) {
                $parent = $view->parent;
            } else {
                $parent = static::getParent($view->parent, $type);
            }
        }

        return $parent;
    }
public static function getParent(BlockView $view, $type)
    {
        $parent = null;

        if (null !== $view->parent) {
            if (static::isType($view->parent, $type)) {
                $parent = $view->parent;
            } else {
                $parent = static::getParent($view->parent, $type);
            }
        }

        return $parent;
    }
public static function getParent ( BlockView $ view , $ type ) { $ parent = null ; if ( null !== $ view -> parent ) { if ( static :: isType ( $ view -> parent , $ type ) ) { $ parent = $ view -> parent ; } else { $ parent = static :: getParent ( $ view -> parent , $ type ) ; } } return $ parent ; }
Get the parent with a specific type.

@param BlockView $view The block view
@param string    $type The first parent type

@return BlockView|null
Get the parent with a specific type .