StofDoctrineExtensionsBundle icon indicating copy to clipboard operation
StofDoctrineExtensionsBundle copied to clipboard

Enable re-generating of slugs for entities via command

Open daFish opened this issue 14 years ago • 8 comments

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'

daFish avatar Jan 02 '12 14:01 daFish

@l3pp4rd is there a way to trigger a regeneration of the slug for an entity in your extensions ?

stof avatar Jan 02 '12 19:01 stof

hi, open it on https://github.com/l3pp4rd/DoctrineExtensions

l3pp4rd avatar Jan 02 '12 21:01 l3pp4rd

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

stof avatar Jan 02 '12 23:01 stof

Done: https://github.com/l3pp4rd/DoctrineExtensions/issues/223

daFish avatar Jan 03 '12 07:01 daFish

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.

daFish avatar Jun 14 '12 06:06 daFish

hm, it needs some improvements, but yes, in general now it is possible and could be added into library

l3pp4rd avatar Jun 14 '12 06:06 l3pp4rd

Has this feature been updated ?

mouskito avatar Apr 19 '17 12:04 mouskito

looks like - not ;) you'll have to implement that on your own

l3pp4rd avatar Apr 19 '17 13:04 l3pp4rd