Skip to content
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

Open
wants to merge 1 commit into
base: 3.x
Choose a base branch
from

Conversation

dantleech
Copy link
Contributor

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 (?)

- Very simple command for simply generating the CND files for
  each document in the given bundle
));
}

return array($extension->getNamespace(), $extension->getAlias());
Copy link
Contributor Author

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)

@dbu
Copy link
Member

dbu commented Jul 20, 2014

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.

@lsmith77
Copy link
Member

lsmith77 commented Aug 1, 2014

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

@dbu
Copy link
Member

dbu commented Sep 21, 2015

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

@dantleech
Copy link
Contributor Author

I guess that would be the expected thing to do.

@dbu dbu changed the base branch from master to 2.x July 4, 2022 08:55
@dbu dbu changed the base branch from 2.x to 3.x May 12, 2023 15:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants