Skip to content

Corrected model folder inside bundle #6375

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

Closed
wants to merge 1 commit into from
Closed

Conversation

sfdumi
Copy link
Contributor

@sfdumi sfdumi commented Mar 15, 2016

According to the best practices, I believe that Entity or Document folders should be used.

According to the best practices, I believe that Entity or Document folders should be used.
@xabbuh
Copy link
Member

xabbuh commented Mar 16, 2016

I would not make this change. The term model here refers to classes that are the model of your domain. That's doesn't tell you anything about whether they are mapped to a database using an object-relational mapper or using something like MongoDB (which would be the case when making this change). As a bundle author I even might not care at all if a concrete project maps model objects to MySQL, MongoDB, or a PHPCR backend (see FOSUserBundle for such an example).

@javiereguiluz
Copy link
Member

I agree with @xabbuh but I understand @sfdumi concerns. We could:

  • Leave Model/ but improving a bit its description (if possible)
  • Add Entity/ for Doctrine ORM entities
  • Add Document/ for Doctrine ODM documents

@sfdumi
Copy link
Contributor Author

sfdumi commented Mar 16, 2016

Sounds reasonable. The fact that model could be used without Doctrine slipped me. Thank you, @xabbuh . :)
I recommend adding Entity and Document, alongside Model, as @javiereguiluz uggested. Suggestion for Models description: Domain models, not mapped by Doctrine. Eg: models used in internal processing and not persisted, passed to external services etc.
How do you feel about this?

@wouterj
Copy link
Member

wouterj commented Jul 9, 2016

I'm actually not sure why we would document the specific location of domain models: Place them anywhere you think makes much sense would be the best option here imo.

Can't we simply remove the "Models" row and add Entity/ and Document/ as proposed by @javiereguiluz?

If you agree, can you maybe update this PR, @sfdumi? I know this PR is stalled for a long time. If you don't have the time to work on it anymore, just leave a comment and we'll finish this.

@xabbuh
Copy link
Member

xabbuh commented Jul 9, 2016

I think I agree with @wouterj. For your own model classes that are not coupled to a specific backend, there are no rules where to store them. Only the location of Doctrine entities and document is important if you do not want to configure all mapping information explicitly.

@javiereguiluz
Copy link
Member

Closing it in favor of #7156 to make the changes requested by doc maintainers. @sfdumi I'm sorry but I couldn't reuse your original commits because the doc structure changed completely since you created this PR.

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.

4 participants