瀏覽代碼

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;