1 – Compositor:
"require": {
"stof/doctrine-extensions-bundle": "dev-master"
}
2- Registro em app / AppKernel.php:
public function registerBundles()
{
return array(
// …
new StofDoctrineExtensionsBundleStofDoctrineExtensionsBundle(),
// …
);
}
3 – Ativando a extensão em config.yml:
stof_doctrine_extensions:
default_locale: en_US
orm:
default:
sluggable: true
timestampable: true # not needed: listeners are not enabled by default
4 – Usando:
namespace SdzBlogBundleEntity;
namespace SavewallCrawlBundleEntity;
use DoctrineORMMapping as ORM;
use GedmoMappingAnnotation as Gedmo;
class Article
{
// …
/**
* @GedmoSlug(fields={"title"})
* @ORMColumn(length=128, unique=true)
*/
private $slug;
}
Voila