src/model/PageSlice.php
private function createSliceID()
    {
        $urlFilter = URLSegmentFilter::create();
        if ($sliceID = $urlFilter->filter($this->getField('Title'))) {
            if (!$this->Parent()->PageSlices()->filter(array('ID:not' => $this->ID, 'SliceID' => $sliceID))->exists()) {
                $this->setField('SliceID', $sliceID);
            } else {
                $this->setField('SliceID', "$sliceID-{$this->ID}");
            }
        }
    }
private function createSliceID()
    {
        $urlFilter = URLSegmentFilter::create();
        if ($sliceID = $urlFilter->filter($this->getField('Title'))) {
            if (!$this->Parent()->PageSlices()->filter(array('ID:not' => $this->ID, 'SliceID' => $sliceID))->exists()) {
                $this->setField('SliceID', $sliceID);
            } else {
                $this->setField('SliceID', "$sliceID-{$this->ID}");
            }
        }
    }
private function createSliceID ( ) { $ urlFilter = URLSegmentFilter :: create ( ) ; if ( $ sliceID = $ urlFilter -> filter ( $ this -> getField ( 'Title' ) ) ) { if ( ! $ this -> Parent ( ) -> PageSlices ( ) -> filter ( array ( 'ID:not' => $ this -> ID , 'SliceID' => $ sliceID ) ) -> exists ( ) ) { $ this -> setField ( 'SliceID' , $ sliceID ) ; } else { $ this -> setField ( 'SliceID' , "$sliceID-{$this->ID}" ) ; } } }
Create a readable ID based on the slice title
Create a readable ID based on the slice title