protected function onAfterWrite() {
        parent::onAfterWrite();
        
        //Write the snippet version record
        if(!empty($this->Text)) {
            $version=new SnippetVersion();
            $version->Text=$this->Text;
            $version->ParentID=$this->ID;
            $version->write();
        }
    }
protected function onAfterWrite() {
        parent::onAfterWrite();
        
        //Write the snippet version record
        if(!empty($this->Text)) {
            $version=new SnippetVersion();
            $version->Text=$this->Text;
            $version->ParentID=$this->ID;
            $version->write();
        }
    }
protected function onAfterWrite ( ) { parent :: onAfterWrite ( ) ; //Write the snippet version record if ( ! empty ( $ this -> Text ) ) { $ version = new SnippetVersion ( ) ; $ version -> Text = $ this -> Text ; $ version -> ParentID = $ this -> ID ; $ version -> write ( ) ; } }
Creates the snippet version record after writing
Creates the snippet version record after writing