Browse Source

Fix para Doctrine

Daniel Libonati 9 năm trước cách đây
mục cha
commit
55f9ab2fe9
1 tập tin đã thay đổi với 5 bổ sung2 xóa
  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;