DoctrinePHPCRBundle icon indicating copy to clipboard operation
DoctrinePHPCRBundle copied to clipboard

[POC] Generate node types command

Open dantleech opened this issue 11 years ago • 4 comments

This is just a quick sketch of a command to generate CND files (just namespaces and names, no properties / children definitions).

In general binding document classes to node types will enable much more efficient filtering and selecting (e.g. SELECT * FROM MyBundle:Article WHERE title = "foobar")

Obviously there is quite a large scope here, but just to follow on from what was the issue where we discussed this?

Next steps:

  • [ ] Add configuration option to automatically assign node types to documents
  • [ ] Provide node type migrate command (?)

dantleech avatar Jul 20 '14 19:07 dantleech

interesting, seems its not even that hard to build basic node type definitions.

i think the logic to build cnd from metadata should go into a service. configured with a map of folders to look in and name prefix to use. that logic should live in phpcr-odm, not the bundle, as its not symfony specific.

and i wonder if we should not generate one single file in the project, in the same principle as the orm doctrine:migrations:* command. depending on what i want to do, i might want the file there, or i could want it with my bundle, if the bundle is its own repository...

migration is problematic, because its not possible to delete node types or remove properties from them.

dbu avatar Jul 20 '14 19:07 dbu

imho this is quite interesting though we then also need to work on better support for changing node types

lsmith77 avatar Aug 01 '14 20:08 lsmith77

should this go into phpcr-odm rather than the bundle?

dbu avatar Sep 21 '15 13:09 dbu

I guess that would be the expected thing to do.

dantleech avatar Sep 22 '15 18:09 dantleech