original_string: public function move(PageInterface $parent)
      {
          if (!$this->_original) {
              $clone = clone $this;
              $this->_original = $clone;
          }
  
          $this->_action = 'move';
  
          if ($this->route() === $parent->route()) {
              throw new \RuntimeException('Failed: Cannot set page parent to self');
          }
          if (Utils::startsWith($parent->rawRoute(), $this->rawRoute())) {
              throw new \RuntimeException('Failed: Cannot set page parent to a child of current page');
          }
  
          $this->parent($parent);
          $this->id(time() . md5($this->filePath()));
  
          if ($parent->path()) {
              $this->path($parent->path() . '/' . $this->folder());
          }
  
          if ($parent->route()) {
              $this->route($parent->route() . '/' . $this->slug());
          } else {
              $this->route(Grav::instance()['pages']->root()->route() . '/' . $this->slug());
          }
  
          $this->raw_route = null;
  
          return $this;
      }
code: public function move(PageInterface $parent)
      {
          if (!$this->_original) {
              $clone = clone $this;
              $this->_original = $clone;
          }
  
          $this->_action = 'move';
  
          if ($this->route() === $parent->route()) {
              throw new \RuntimeException('Failed: Cannot set page parent to self');
          }
          if (Utils::startsWith($parent->rawRoute(), $this->rawRoute())) {
              throw new \RuntimeException('Failed: Cannot set page parent to a child of current page');
          }
  
          $this->parent($parent);
          $this->id(time() . md5($this->filePath()));
  
          if ($parent->path()) {
              $this->path($parent->path() . '/' . $this->folder());
          }
  
          if ($parent->route()) {
              $this->route($parent->route() . '/' . $this->slug());
          } else {
              $this->route(Grav::instance()['pages']->root()->route() . '/' . $this->slug());
          }
  
          $this->raw_route = null;
  
          return $this;
      }
code_tokens: public function move ( PageInterface $ parent ) { if ( ! $ this -> _original ) { $ clone = clone $ this ; $ this -> _original = $ clone ; } $ this -> _action = 'move' ; if ( $ this -> route ( ) === $ parent -> route ( ) ) { throw new \ RuntimeException ( 'Failed: Cannot set page parent to self' ) ; } if ( Utils :: startsWith ( $ parent -> rawRoute ( ) , $ this -> rawRoute ( ) ) ) { throw new \ RuntimeException ( 'Failed: Cannot set page parent to a child of current page' ) ; } $ this -> parent ( $ parent ) ; $ this -> id ( time ( ) . md5 ( $ this -> filePath ( ) ) ) ; if ( $ parent -> path ( ) ) { $ this -> path ( $ parent -> path ( ) . '/' . $ this -> folder ( ) ) ; } if ( $ parent -> route ( ) ) { $ this -> route ( $ parent -> route ( ) . '/' . $ this -> slug ( ) ) ; } else { $ this -> route ( Grav :: instance ( ) [ 'pages' ] -> root ( ) -> route ( ) . '/' . $ this -> slug ( ) ) ; } $ this -> raw_route = null ; return $ this ; }
docstring: Prepare move page to new location. Moves also everything that's under the current page.
  
  You need to call $this->save() in order to perform the move.
  
  @param PageInterface $parent New parent page.
  
  @return $this
docstring_tokens: Prepare move page to new location . Moves also everything that s under the current page .