code: public function onBeforeWrite(){
  		if($this->owner->Title){			
  			$this->owner->URLSegment = $this->generateURLSegment($this->owner->Title);				
  		}
  		parent::onBeforeWrite();
  	}
docs: Generate a URL Segement before the data object gets written