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

DCOM-73: CodeGeneration using Doctrine\Common\Persistence\Mapping\ObjectMetadata #673

Closed
doctrinebot opened this issue Oct 24, 2011 · 1 comment

Comments

@doctrinebot
Copy link

Jira issue originally created by user @beberlei:

Currently we have tons of code in the ODM/ORMs regarding code generation that are ugly to extend and maintain. We should extract all them into a new component, for example named: doctrine-code-generator

  • It should be feed by only instances of Doctrine\Common\Persistence\Mapping\ObjectMetadata into a twig template.
  • A base template for an entity/document is shipped
  • Maybe ORM/ODM specific child templates or twig traits are necessary to handle writing annotations. This could also be done by adding hooks into the code-generation somehow.
  • Each entity of the user can provide its own template, for examples from a configurable directory "code_templates/Vendor.ProjectBundle.Entity.User.twig" to extend the base template and add own code.
  • As a perspective we should aim for 5.4 generating a trait so that you can have your entity "class User { use UserBase; }"
@Majkl578
Copy link
Contributor

Entity/repository codegen component in ORM has been dropped (doctrine/orm#6870) without replacement, this issue is no longer relevant.

For generic codegen, nikic/php-parser or nette/php-generator could be used.

@Majkl578 Majkl578 assigned Majkl578 and unassigned jwage Oct 31, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants