original_string: private function getDestinationClass() {
          if(empty($this->record) || $this->record===false) {
              return false;
          }
          
          $convertToClass=false;
          
          if(class_exists($this->record->DestinationClass) && is_subclass_of($this->record->DestinationClass, 'SiteTree')) {
              $convertToClass=$this->record->DestinationClass;
          }else {
              $parentClasses=array_reverse(ClassInfo::dataClassesFor($this->record->ClassName));
              unset($parentClasses[$this->record->ClassName]);
              unset($parentClasses['KapostObject']);
          
              if(count($parentClasses)>0) {
                  foreach($parentClasses as $class) {
                      $sng=singleton($class);
                      if(class_exists($sng->DestinationClass) && is_subclass_of($sng->DestinationClass, 'SiteTree')) {
                          $convertToClass=$sng->DestinationClass;
                          break;
                      }
                  }
          
                  if(isset($sng)) {
                      unset($sng);
                  }
              }
          }
          
          return $convertToClass;
      }
code: private function getDestinationClass() {
          if(empty($this->record) || $this->record===false) {
              return false;
          }
          
          $convertToClass=false;
          
          if(class_exists($this->record->DestinationClass) && is_subclass_of($this->record->DestinationClass, 'SiteTree')) {
              $convertToClass=$this->record->DestinationClass;
          }else {
              $parentClasses=array_reverse(ClassInfo::dataClassesFor($this->record->ClassName));
              unset($parentClasses[$this->record->ClassName]);
              unset($parentClasses['KapostObject']);
          
              if(count($parentClasses)>0) {
                  foreach($parentClasses as $class) {
                      $sng=singleton($class);
                      if(class_exists($sng->DestinationClass) && is_subclass_of($sng->DestinationClass, 'SiteTree')) {
                          $convertToClass=$sng->DestinationClass;
                          break;
                      }
                  }
          
                  if(isset($sng)) {
                      unset($sng);
                  }
              }
          }
          
          return $convertToClass;
      }
code_tokens: private function getDestinationClass ( ) { if ( empty ( $ this -> record ) || $ this -> record === false ) { return false ; } $ convertToClass = false ; if ( class_exists ( $ this -> record -> DestinationClass ) && is_subclass_of ( $ this -> record -> DestinationClass , 'SiteTree' ) ) { $ convertToClass = $ this -> record -> DestinationClass ; } else { $ parentClasses = array_reverse ( ClassInfo :: dataClassesFor ( $ this -> record -> ClassName ) ) ; unset ( $ parentClasses [ $ this -> record -> ClassName ] ) ; unset ( $ parentClasses [ 'KapostObject' ] ) ; if ( count ( $ parentClasses ) > 0 ) { foreach ( $ parentClasses as $ class ) { $ sng = singleton ( $ class ) ; if ( class_exists ( $ sng -> DestinationClass ) && is_subclass_of ( $ sng -> DestinationClass , 'SiteTree' ) ) { $ convertToClass = $ sng -> DestinationClass ; break ; } } if ( isset ( $ sng ) ) { unset ( $ sng ) ; } } } return $ convertToClass ; }
docstring: Gets the destination class for the record
  @return string|bool Returns the destination class name or false if it can't be found
docstring_tokens: Gets the destination class for the record