i did that in the sonata bundle here
https://github.com/sonata-project/SonataDoctrinePhpcrAdminBundle/commit/8c804f10d78522751d4de4cfc9fcea5eecb5786f