Enable re-generating of slugs for entities via command
I recently came to a point where I needed to re-generate the slugs for all entities and haven't found a way to do so in a convenient manner.
So I'd like to propose a command which would be able to re-generate all slugs for an given entity, e.g.:
php app/console doctrine:extensions:slug regenerate 'VendorMyBundle:Foo'
@l3pp4rd is there a way to trigger a regeneration of the slug for an entity in your extensions ?
hi, open it on https://github.com/l3pp4rd/DoctrineExtensions
yeah, it seems that adding the command in the bundle requires changes in the library first. Keep it open here too with a reference to the other ticket
Done: https://github.com/l3pp4rd/DoctrineExtensions/issues/223
I saw that we now have the ability to force regeneration of a slug by setting it so null. So I came up with the following command https://gist.github.com/95b08d3a9aeecde49133. I tested it with 3000+ entities yesterday and it worked great.
I would refactor large parts out into dedicated classes and open a PR if its wanted.
hm, it needs some improvements, but yes, in general now it is possible and could be added into library
Has this feature been updated ?
looks like - not ;) you'll have to implement that on your own