src/RestoreAction.php
public static function shouldRestoreToRoot($record)
    {
        // If the record had a parent and that no longer exists in draft then yes
        if ($record->hasExtension(Hierarchy::class) && $record->ParentID != false) {
            return $record->getParent() === null;
        }

        // Otherwise it should be restored normally
        return false;
    }
public static function shouldRestoreToRoot($record)
    {
        // If the record had a parent and that no longer exists in draft then yes
        if ($record->hasExtension(Hierarchy::class) && $record->ParentID != false) {
            return $record->getParent() === null;
        }

        // Otherwise it should be restored normally
        return false;
    }
public static function shouldRestoreToRoot ( $ record ) { // If the record had a parent and that no longer exists in draft then yes if ( $ record -> hasExtension ( Hierarchy :: class ) && $ record -> ParentID != false ) { return $ record -> getParent ( ) === null ; } // Otherwise it should be restored normally return false ; }
Determines whether this record can be restored to it's original location

@param $record
@return bool
Determines whether this record can be restored to it s original location