I am working with Symfony, and I am trying to slug some element of my database using Doctrine's extension Gedmo. The issue is that I initialize my database with a sql script, so I dont trigger the generation of the slug by Doctrine.
I would like to know if there is a clean way to generate it. For instance:
public function getSlug(){
if(empty($this->slug)){
$this->slug=generateSlug();
}
return $this->slug;
;
I could not find any solution.
Thanks.
From the sluggable readme: https://github.com/Atlantic18/DoctrineExtensions/blob/master/doc/sluggable.md
Update 2013-08-19
allow empty slug #807 regenerate slug only if set to null
so:
null
And you are done !