{"action":"opened","issue":{"url":"https://api.github.com/repos/symfony/symfony/issues/18789","repository_url":"https://api.github.com/repos/symfony/symfony","labels_url":"https://api.github.com/repos/symfony/symfony/issues/18789/labels{/name}","comments_url":"https://api.github.com/repos/symfony/symfony/issues/18789/comments","events_url":"https://api.github.com/repos/symfony/symfony/issues/18789/events","html_url":"https://github.com/symfony/symfony/issues/18789","id":154926271,"number":18789,"title":"Extend doctrine ORM definitions (between bundles)","user":{"login":"sourcerer-mike","id":2559177,"avatar_url":"https://avatars.githubusercontent.com/u/2559177?v=3","gravatar_id":"","url":"https://api.github.com/users/sourcerer-mike","html_url":"https://github.com/sourcerer-mike","followers_url":"https://api.github.com/users/sourcerer-mike/followers","following_url":"https://api.github.com/users/sourcerer-mike/following{/other_user}","gists_url":"https://api.github.com/users/sourcerer-mike/gists{/gist_id}","starred_url":"https://api.github.com/users/sourcerer-mike/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sourcerer-mike/subscriptions","organizations_url":"https://api.github.com/users/sourcerer-mike/orgs","repos_url":"https://api.github.com/users/sourcerer-mike/repos","events_url":"https://api.github.com/users/sourcerer-mike/events{/privacy}","received_events_url":"https://api.github.com/users/sourcerer-mike/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-05-15T19:46:29Z","updated_at":"2016-05-15T19:46:29Z","closed_at":null,"body":"Hello. With doctrine you give the option to define the ORM / Entities via XML within every bundle.\r\nThe shell `bin/console doctrine:generate:entities` creates those entities and is also capable of creating the DB schema. \r\n\r\nBut there is a scenario, that doctrine / symfony does not handle yet. Imagine SecondBundle extending the entities of the MainBundle. The MainBundle could have something like this:\r\n\r\n```\r\n<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\r\n<doctrine-mapping xmlns=\"http://doctrine-project.org/schemas/orm/doctrine-mapping\">\r\n\r\n    <entity name=\"App\\MainBundle\\Entity\\Foo1405\" table=\"foo1405\">\r\n        <id name=\"id\" type=\"integer\">\r\n            <generator strategy=\"AUTO\" />\r\n        </id>\r\n        <field name=\"name\" type=\"string\" length=\"100\" />\r\n    </entity>\r\n</doctrine-mapping>\r\n```\r\n\r\nAnd the SecondBundle adds functionality and structure:\r\n\r\n\r\n```\r\n<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\r\n<doctrine-mapping xmlns=\"http://doctrine-project.org/schemas/orm/doctrine-mapping\">\r\n\r\n    <entity name=\"Crmp\\SecondBundle\\Entity\\Bar1405\" table=\"bar1405\">\r\n        <id name=\"id\" type=\"integer\">\r\n            <generator strategy=\"AUTO\"/>\r\n        </id>\r\n        <field name=\"name\" type=\"string\" length=\"100\"/>\r\n        <field name=\"customer\" type=\"id\" />\r\n\r\n        <many-to-one target-entity=\"Crmp\\CrmBundle\\Entity\\Foo1405\" field=\"foos\" />\r\n    </entity>\r\n\r\n    <entity name=\"Crmp\\CrmBundle\\Entity\\Foo1405\">\r\n        <one-to-many target-entity=\"Crmp\\AcquisitionBundle\\Entity\\Bar1405\"\r\n                     mapped-by=\"customer\"\r\n                    field=\"customer\">\r\n        </one-to-many>\r\n    </entity>\r\n</doctrine-mapping>\r\n```\r\n\r\nIt would be useful it symfony merges those two definitions. So that the command\r\n\r\n    bin/console doctrine:generate:entities MainBundle\r\n\r\nNot only uses the first XML but also takes note of the second bundle or other way round (might be better). The SecondBundle updates the entities in the MainBundle.\r\n\r\nSymfony is a great framework to create own apps. It's only and last flaw is, that it does not allow plugins for this app. You always have to create your own plugin architecture. With the solution above Symfony will take that pain away and be a full stack framework, delivering a solution for plugins via just using bundles. KISS!"}}