public function setSlug($slug)
    {
        if ($slug !== null) {
            $slug = (string) $slug;
        }

        $this->slug = $slug;
    }
public function setSlug($slug)
    {
        if ($slug !== null) {
            $slug = (string) $slug;
        }

        $this->slug = $slug;
    }
public function setSlug ( $ slug ) { if ( $ slug !== null ) { $ slug = ( string ) $ slug ; } $ this -> slug = $ slug ; }
Setting to null should regenerate the slug

@param string|null $slug
Setting to null should regenerate the slug