public function rename($view, $name)
    {
        if ($view instanceof View) {
            $view = $view->getName();
        }

        $params = [View::ENTRY_NAME => $name];
        $this->getConnection()->put(
            UrlHelper::buildUrl(Urls::URL_VIEW, [$view, self::OPTION_RENAME]),
            $this->json_encode_wrapper($params)
        );

        return true;
    }
public function rename($view, $name)
    {
        if ($view instanceof View) {
            $view = $view->getName();
        }

        $params = [View::ENTRY_NAME => $name];
        $this->getConnection()->put(
            UrlHelper::buildUrl(Urls::URL_VIEW, [$view, self::OPTION_RENAME]),
            $this->json_encode_wrapper($params)
        );

        return true;
    }
public function rename ( $ view , $ name ) { if ( $ view instanceof View ) { $ view = $ view -> getName ( ) ; } $ params = [ View :: ENTRY_NAME => $ name ] ; $ this -> getConnection ( ) -> put ( UrlHelper :: buildUrl ( Urls :: URL_VIEW , [ $ view , self :: OPTION_RENAME ] ) , $ this -> json_encode_wrapper ( $ params ) ) ; return true ; }
Rename a view

@throws Exception

@param mixed $view - view name as a string or instance of View
@param string $name       - new name for collection

@return bool - always true, will throw if there is an error
Rename a view