code/SeoFriendlyDataObject.php
protected function generateURLSegment($title){
		$filter = URLSegmentFilter::create();
		$t = $filter->filter($title);
		
		// Fallback to generic name if path is empty (= no valid, convertable characters)
		if(!$t || $t == '-' || $t == '-1') {
			$t = "{$this->owner->ClassName}-{$this->owner->ID}";
		} else {
			// Make sure that it does not already exists for another object
			$class = $this->owner->ClassName;
			$obj = $class::get()
					->filter(array("URLSegment" => $t))
					->exclude(array("ID" => $this->owner->ID))
					->first();
			if($obj){
				$t .= "-{$this->owner->ID}";
			}
		}

		return $t;
	}
protected function generateURLSegment($title){
		$filter = URLSegmentFilter::create();
		$t = $filter->filter($title);
		
		// Fallback to generic name if path is empty (= no valid, convertable characters)
		if(!$t || $t == '-' || $t == '-1') {
			$t = "{$this->owner->ClassName}-{$this->owner->ID}";
		} else {
			// Make sure that it does not already exists for another object
			$class = $this->owner->ClassName;
			$obj = $class::get()
					->filter(array("URLSegment" => $t))
					->exclude(array("ID" => $this->owner->ID))
					->first();
			if($obj){
				$t .= "-{$this->owner->ID}";
			}
		}

		return $t;
	}
Generate a URL segment based on the title provided.

@param string $title Page title.
@return string Generated url segment