From 86c12a07e581701de0ec4d53d8bf8962034f810f Mon Sep 17 00:00:00 2001
From: romanb <romanb@625475ce-881a-0410-a577-b389adb331d8>
Date: Thu, 11 Feb 2010 09:48:57 +0000
Subject: [PATCH] [2.0] Fixed proxy classes to not invoke parent class
 constructors. We never call constructors to reconstitute persistent entities
 and proxies always represent persistent entities.

---
 lib/Doctrine/ORM/Proxy/ProxyFactory.php | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/lib/Doctrine/ORM/Proxy/ProxyFactory.php b/lib/Doctrine/ORM/Proxy/ProxyFactory.php
index 2ef9d8af4..3d4322dfe 100644
--- a/lib/Doctrine/ORM/Proxy/ProxyFactory.php
+++ b/lib/Doctrine/ORM/Proxy/ProxyFactory.php
@@ -121,19 +121,16 @@ class ProxyFactory
      * @param $originalClassName
      * @param $proxyClassName
      * @param $file The path of the file to write to.
-     * @return void
      */
     private function _generateProxyClass($class, $proxyClassName, $fileName, $file)
     {
         $methods = $this->_generateMethods($class);
         $sleepImpl = $this->_generateSleep($class);
-        $constructorInv = $class->reflClass->hasMethod('__construct') ? 'parent::__construct();' : '';
 
         $placeholders = array(
             '<namespace>',
             '<proxyClassName>', '<className>',
-            '<methods>', '<sleepImpl>',
-            '<constructorInvocation>'
+            '<methods>', '<sleepImpl>'
         );
 
         if(substr($class->name, 0, 1) == "\\") {
@@ -145,8 +142,7 @@ class ProxyFactory
         $replacements = array(
             $this->_proxyNamespace,
             $proxyClassName, $className,
-            $methods, $sleepImpl,
-            $constructorInv
+            $methods, $sleepImpl
         );
         
         $file = str_replace($placeholders, $replacements, $file);
@@ -258,7 +254,6 @@ namespace <namespace> {
         public function __construct($entityPersister, $identifier) {
             $this->_entityPersister = $entityPersister;
             $this->_identifier = $identifier;
-            <constructorInvocation>
         }
         private function _load() {
             if (!$this->__isInitialized__) {