I'm using DoctrineExtensions and followed the docs. I have my Entity field decorated with the Sluggable annotation:
use Gedmo\Mapping\Annotation as Gedmo;
.
.
.
/**
* @Gedmo\Slug(fields={"city"}, updatable=false)
* @ORM\Column(length=255)
*/
private $slug;
When I try to persist a new entity I get an SQL error:
Persist:
$em = $this->getDoctrine()->getManager();
$em->persist($location);
$em->flush();
Error:
SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'slug' cannot be null
config.yml:
# Stof Doctrine Extensions
stof_doctrine_extensions:
orm:
default:
sluggable: true
According to the docs this is all I need, yet the slug is not being generated.