original_string: protected function onBeforeWrite() {
          parent::onBeforeWrite();
          
          if($this->ID==0) {
              $this->CreatorID=Member::currentUserID();
          }else {
              $this->LastEditorID=Member::currentUserID();
              
              //If the language is changing reset the folder id
              if($this->isChanged('LanguageID')) {
                  $this->FolderID=0;
              }
          }
      }
code: protected function onBeforeWrite() {
          parent::onBeforeWrite();
          
          if($this->ID==0) {
              $this->CreatorID=Member::currentUserID();
          }else {
              $this->LastEditorID=Member::currentUserID();
              
              //If the language is changing reset the folder id
              if($this->isChanged('LanguageID')) {
                  $this->FolderID=0;
              }
          }
      }
code_tokens: protected function onBeforeWrite ( ) { parent :: onBeforeWrite ( ) ; if ( $ this -> ID == 0 ) { $ this -> CreatorID = Member :: currentUserID ( ) ; } else { $ this -> LastEditorID = Member :: currentUserID ( ) ; //If the language is changing reset the folder id if ( $ this -> isChanged ( 'LanguageID' ) ) { $ this -> FolderID = 0 ; } } }
docstring: Sets the creator id for new snippets and sets the last editor id for existing snippets
docstring_tokens: Sets the creator id for new snippets and sets the last editor id for existing snippets