فهرست منبع

Fix para Doctrine

Daniel Libonati 9 سال پیش
والد
کامیت
55f9ab2fe9
1فایلهای تغییر یافته به همراه5 افزوده شده و 2 حذف شده
  1. 5 2
      lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php

+ 5 - 2
lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php

@@ -728,8 +728,11 @@ class ClassMetadataInfo implements ClassMetadata
      */
     public function newInstance()
     {
-        if ($this->_prototype === null) {
-            $this->_prototype = unserialize(sprintf('O:%d:"%s":0:{}', strlen($this->name), $this->name));
+	if ($this->_prototype === null) {
+            $this->_prototype = @unserialize(sprintf('O:%d:"%s":0:{}', strlen($this->name), $this->name));
+            if ($this->_prototype === false) {
+                $this->_prototype = @unserialize(sprintf('C:%d:"%s":0:{}', strlen($this->name), $this->name));
+            }
         }
 
         return clone $this->_prototype;