{"action":"created","issue":{"url":"https://api.github.com/repos/concrete5/concrete5/issues/3495","repository_url":"https://api.github.com/repos/concrete5/concrete5","labels_url":"https://api.github.com/repos/concrete5/concrete5/issues/3495/labels{/name}","comments_url":"https://api.github.com/repos/concrete5/concrete5/issues/3495/comments","events_url":"https://api.github.com/repos/concrete5/concrete5/issues/3495/events","html_url":"https://github.com/concrete5/concrete5/issues/3495","id":131512880,"number":3495,"title":"Unify application, core and package entity managers","user":{"login":"aembler","id":527809,"avatar_url":"https://avatars.githubusercontent.com/u/527809?v=3","gravatar_id":"","url":"https://api.github.com/users/aembler","html_url":"https://github.com/aembler","followers_url":"https://api.github.com/users/aembler/followers","following_url":"https://api.github.com/users/aembler/following{/other_user}","gists_url":"https://api.github.com/users/aembler/gists{/gist_id}","starred_url":"https://api.github.com/users/aembler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aembler/subscriptions","organizations_url":"https://api.github.com/users/aembler/orgs","repos_url":"https://api.github.com/users/aembler/repos","events_url":"https://api.github.com/users/aembler/events{/privacy}","received_events_url":"https://api.github.com/users/aembler/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/concrete5/concrete5/labels/accepted:info%20needed","name":"accepted:info needed","color":"bfe5bf"},{"url":"https://api.github.com/repos/concrete5/concrete5/labels/priority:love%20to%20have","name":"priority:love to have","color":"5319e7"},{"url":"https://api.github.com/repos/concrete5/concrete5/labels/type:enhancement","name":"type:enhancement","color":"207de5"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":15,"created_at":"2016-02-05T00:09:06Z","updated_at":"2016-02-16T21:32:33Z","closed_at":"2016-02-16T16:59:49Z","body":"This is related to \r\n\r\n#3472 and #1866 \r\n\r\nFirst off, @ahukkanen did great work on getting the entity managers in 5.7 to where they are now. Using doctrine in packages wasn't even really possible when 5.7.0 launched. Now it works very well.\r\n\r\nUnfortunately, these things are walled gardens. I'm running into very real, serious limitations with a package that uses entity inheritance to extend a core entity, with a class that's in a package. Since the package entity manager is a separate entity manager from the core, the core doesn't always know about the package and vice versa. Amazingly it sometimes works – but then once you clear cache things die. \r\n\r\nI propose we dramatically simplify the way we're working with entity managers. I think there ought to be one single entity manager (By default). Then, any time a package starts up in on_start() and/or in installation/upgrade, it simply adds its entity classes to the entity manager. By default, this is the package's src/ directory – but a package controller could override that to point to packages/my_package/src/Entity if they didn't want to autoload all their packages.\r\n\r\nI think we keep some of our convenience methods in the core for creating these entity managers, so that it's totally possible to have a completely separate, custom entity manager with its own driver chain, mapping drivers, custom bundles, etc... But I think the core entity manager and all package and application entity managers, by default, ought to be shared.\r\n\r\nThoughts? Specifically from @ahukkanen since you know more about this than most. Finally, this would let us use dependency injection much more reliably with the entity manager – so that there'd be one shared entity manager that we could easily inject into all controllers, etc... rather than injecting the package one in certain controllers – or worse, having a core one injected automatically, and accidentally trying to use a package based one for core entity manager calls or vice versa.\r\n\r\nWould you be willing to work on something like this? I don't think it'd take that long but you'd probably be faster at it than I. As I mentioned it's very quickly becoming a problem, specifically with a core calendar add-on I'm making work with the attributes that are in the release/8.0.0 branch."},"comment":{"url":"https://api.github.com/repos/concrete5/concrete5/issues/comments/184882650","html_url":"https://github.com/concrete5/concrete5/issues/3495#issuecomment-184882650","issue_url":"https://api.github.com/repos/concrete5/concrete5/issues/3495","id":184882650,"user":{"login":"aembler","id":527809,"avatar_url":"https://avatars.githubusercontent.com/u/527809?v=3","gravatar_id":"","url":"https://api.github.com/users/aembler","html_url":"https://github.com/aembler","followers_url":"https://api.github.com/users/aembler/followers","following_url":"https://api.github.com/users/aembler/following{/other_user}","gists_url":"https://api.github.com/users/aembler/gists{/gist_id}","starred_url":"https://api.github.com/users/aembler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aembler/subscriptions","organizations_url":"https://api.github.com/users/aembler/orgs","repos_url":"https://api.github.com/users/aembler/repos","events_url":"https://api.github.com/users/aembler/events{/privacy}","received_events_url":"https://api.github.com/users/aembler/received_events","type":"User","site_admin":false},"created_at":"2016-02-16T21:32:32Z","updated_at":"2016-02-16T21:32:32Z","body":"https://github.com/concrete5/concrete5/commit/8a5b34dde8d81f98517f18ece8cd7da104689732\n\nOn Tue, Feb 16, 2016 at 10:58 AM, Korvin Szanto <notifications@github.com>\nwrote:\n\n> @aembler <https://github.com/aembler> are there more commits that\n> resolved this?\n>\n> —\n> Reply to this email directly or view it on GitHub\n> <https://github.com/concrete5/concrete5/issues/3495#issuecomment-184830686>\n> .\n>\n"}}