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;
            }
        }
    }
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;
            }
        }
    }
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 ; } } }
Sets the creator id for new snippets and sets the last editor id for existing snippets
Sets the creator id for new snippets and sets the last editor id for existing snippets