Uploaded image for project: 'Doctrine 2 - ORM'
  1. Doctrine 2 - ORM
  2. DDC-1076

It should be possible to supply EntityManager with a custom ProxyFactory

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Trivial
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: ORM
    • Security Level: All
    • Labels:
      None

      Description

      It is plausible that one might want to handle the loading of proxy classes in their own way, perhaps not using the filename/class scheme doctrine currently comes with.

      Currently the only way to provide your own implementation of ProxyFactory is to subclass EntityManager. Even this is not clean since one also must copy/paste the EntityManager::create factory method to get identical behavior.

      It would be nice if there was a ProxyFactory interface and one could provide an instance of it to Doctrine\ORM\Configuration when creating an EntityManager.

        Activity

        putgeminmouth David Reisch created issue -
        Hide
        putgeminmouth David Reisch added a comment -

        I would be happy to contribute a patch to this end.

        Show
        putgeminmouth David Reisch added a comment - I would be happy to contribute a patch to this end.
        Hide
        beberlei Benjamin Eberlei added a comment -

        Can you elaborate on your use-case? proxies are sorft of a by product, to be genreated in a temporary cache directory. I don't see why one should bother about how it is done.

        Show
        beberlei Benjamin Eberlei added a comment - Can you elaborate on your use-case? proxies are sorft of a by product, to be genreated in a temporary cache directory. I don't see why one should bother about how it is done.
        Hide
        putgeminmouth David Reisch added a comment -

        Hi,
        I think allowing users to specify their own implementations for things is pretty essential for a library, especially when there is no cost in complexity or implementation.

        Anyhow, here's my pitch:

        I personally do not like using inheritance for proxies (it feels hackish to me), preferring instead to have interfaces for my Business Objects which the proxies implement. To that end, I do not generate my proxies with doctrine, but maintain my own, in my code base, and the class files do not necessarily match up to the doctrine ProxyFactory's assumptions about where to find the classes.

        Regards,

        Show
        putgeminmouth David Reisch added a comment - Hi, I think allowing users to specify their own implementations for things is pretty essential for a library, especially when there is no cost in complexity or implementation. Anyhow, here's my pitch: I personally do not like using inheritance for proxies (it feels hackish to me), preferring instead to have interfaces for my Business Objects which the proxies implement. To that end, I do not generate my proxies with doctrine, but maintain my own, in my code base, and the class files do not necessarily match up to the doctrine ProxyFactory's assumptions about where to find the classes. Regards,
        beberlei Benjamin Eberlei made changes -
        Field Original Value New Value
        Workflow jira [ 12493 ] jira-feedback [ 13915 ]
        beberlei Benjamin Eberlei made changes -
        Workflow jira-feedback [ 13915 ] jira-feedback2 [ 15779 ]
        beberlei Benjamin Eberlei made changes -
        Workflow jira-feedback2 [ 15779 ] jira-feedback3 [ 18036 ]

        This list may be incomplete, as errors occurred whilst retrieving source from linked applications:

        • Request to http://www.doctrine-project.org/fisheye/ failed: Error in remote call to 'FishEye 0 (http://www.doctrine-project.org/fisheye/)' (http://www.doctrine-project.org/fisheye) [AbstractRestCommand{path='/rest-service-fe/search-v1/crossRepositoryQuery', params={expand=changesets[0:20].revisions[0:29],reviews, query=DDC-1076}, methodType=GET}] : Received status code 503 (Service Temporarily Unavailable)

          People

          • Assignee:
            beberlei Benjamin Eberlei
            Reporter:
            putgeminmouth David Reisch
          • Votes:
            2 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated: