public function doRestoreToStage()
    {
        $this->invokeWithExtensions('onBeforeRestoreToStage', $this);

        // Ensure that the parent page is restored, otherwise restore to root
        if ($this->isParentArchived()) {
            $this->ParentID = 0;
        }

        // Restore
        $this->writeToStage(Versioned::DRAFT);

        // Need to update pages linking to this one as no longer broken
        /** @var SiteTree $result */
        $result = Versioned::get_by_stage(self::class, Versioned::DRAFT)
            ->byID($this->ID);
        $result->updateDependentPages();

        $this->invokeWithExtensions('onAfterRestoreToStage', $result);

        return $result;
    }
public function doRestoreToStage()
    {
        $this->invokeWithExtensions('onBeforeRestoreToStage', $this);

        // Ensure that the parent page is restored, otherwise restore to root
        if ($this->isParentArchived()) {
            $this->ParentID = 0;
        }

        // Restore
        $this->writeToStage(Versioned::DRAFT);

        // Need to update pages linking to this one as no longer broken
        /** @var SiteTree $result */
        $result = Versioned::get_by_stage(self::class, Versioned::DRAFT)
            ->byID($this->ID);
        $result->updateDependentPages();

        $this->invokeWithExtensions('onAfterRestoreToStage', $result);

        return $result;
    }
public function doRestoreToStage ( ) { $ this -> invokeWithExtensions ( 'onBeforeRestoreToStage' , $ this ) ; // Ensure that the parent page is restored, otherwise restore to root if ( $ this -> isParentArchived ( ) ) { $ this -> ParentID = 0 ; } // Restore $ this -> writeToStage ( Versioned :: DRAFT ) ; // Need to update pages linking to this one as no longer broken /** @var SiteTree $result */ $ result = Versioned :: get_by_stage ( self :: class , Versioned :: DRAFT ) -> byID ( $ this -> ID ) ; $ result -> updateDependentPages ( ) ; $ this -> invokeWithExtensions ( 'onAfterRestoreToStage' , $ result ) ; return $ result ; }
Restore the content in the active copy of this SiteTree page to the stage site.

@return static
Restore the content in the active copy of this SiteTree page to the stage site .