original_string: public static function calc_base_directory_for_object(DataObject $do)
      {
  
          //the 2 base options - dataobjects / pages
          $str = 'dataobjects';
          $ancestry = $do->getClassAncestry();
          foreach ($ancestry as $c) {
              if ($c == 'SiteTree') {
                  $str = 'pages';
              }
          }
  
          //other options
          switch ($do->ClassName) {
  
              //case 'Subsite':
              //	$str = 'subsites';
              //	break;
  
              case 'SiteConfig':
                  $str = 'site';
                  break;
  
              default:
          }
  
          return $str;
      }
code: public static function calc_base_directory_for_object(DataObject $do)
      {
  
          //the 2 base options - dataobjects / pages
          $str = 'dataobjects';
          $ancestry = $do->getClassAncestry();
          foreach ($ancestry as $c) {
              if ($c == 'SiteTree') {
                  $str = 'pages';
              }
          }
  
          //other options
          switch ($do->ClassName) {
  
              //case 'Subsite':
              //	$str = 'subsites';
              //	break;
  
              case 'SiteConfig':
                  $str = 'site';
                  break;
  
              default:
          }
  
          return $str;
      }
code_tokens: public static function calc_base_directory_for_object ( DataObject $ do ) { //the 2 base options - dataobjects / pages $ str = 'dataobjects' ; $ ancestry = $ do -> getClassAncestry ( ) ; foreach ( $ ancestry as $ c ) { if ( $ c == 'SiteTree' ) { $ str = 'pages' ; } } //other options switch ( $ do -> ClassName ) { //case 'Subsite': //	$str = 'subsites'; //	break; case 'SiteConfig' : $ str = 'site' ; break ; default : } return $ str ; }
docstring: Base rules.
  
  @param DataObject $do
  
  @return string
docstring_tokens: Base rules .