-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[POC] Generate node types command #157
base: 3.x
Are you sure you want to change the base?
Conversation
- Very simple command for simply generating the CND files for each document in the given bundle
)); | ||
} | ||
|
||
return array($extension->getNamespace(), $extension->getAlias()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can get a namespace URL from the bundle container extension, which is quite neat.
I also use the name of the extension as the alias, we could also use the bundle name (normally the difference between acme_basic_cms
and AcmeBasicCmsBundle
)
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. |
imho this is quite interesting though we then also need to work on better support for changing node types |
should this go into phpcr-odm rather than the bundle? |
I guess that would be the expected thing to do. |
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: