original_string: public function findOrMakeAssetsFolder($url, $doWrite = true)
      {
          $owner = $this->owner;
          $dir = Folder::find_or_make($url);
          $owner->AssetsFolderID = $dir->ID;
          if ($doWrite) {
              $owner->write();
          }
  
          //Special case for when creating a new subsite
          //the directory will need to be associated with the subsite
          if ($owner->ClassName == 'Subsite') {
              $dir->SubsiteID = $owner->ID;
              $dir->write();
          }
  
          return $dir;
      }
code: public function findOrMakeAssetsFolder($url, $doWrite = true)
      {
          $owner = $this->owner;
          $dir = Folder::find_or_make($url);
          $owner->AssetsFolderID = $dir->ID;
          if ($doWrite) {
              $owner->write();
          }
  
          //Special case for when creating a new subsite
          //the directory will need to be associated with the subsite
          if ($owner->ClassName == 'Subsite') {
              $dir->SubsiteID = $owner->ID;
              $dir->write();
          }
  
          return $dir;
      }
code_tokens: public function findOrMakeAssetsFolder ( $ url , $ doWrite = true ) { $ owner = $ this -> owner ; $ dir = Folder :: find_or_make ( $ url ) ; $ owner -> AssetsFolderID = $ dir -> ID ; if ( $ doWrite ) { $ owner -> write ( ) ; } //Special case for when creating a new subsite //the directory will need to be associated with the subsite if ( $ owner -> ClassName == 'Subsite' ) { $ dir -> SubsiteID = $ owner -> ID ; $ dir -> write ( ) ; } return $ dir ; }
docstring: Find or make assets folder
  called from onBeforeWrite.
  
  @param string $url
  @param bool   $doWrite
  
  @return Folder|null
docstring_tokens: Find or make assets folder called from onBeforeWrite .