diff --git a/lib/Doctrine/ORM/Tools/EntityGenerator.php b/lib/Doctrine/ORM/Tools/EntityGenerator.php index 28acc40a4a6..495be60e934 100644 --- a/lib/Doctrine/ORM/Tools/EntityGenerator.php +++ b/lib/Doctrine/ORM/Tools/EntityGenerator.php @@ -189,6 +189,8 @@ public function writeEntityClass(ClassMetadataInfo $metadata, $outputDirectory) if ( ! $this->_isNew) { $this->_parseTokensInEntityFile(file_get_contents($path)); + } else { + $this->_staticReflection[$metadata->name] = array('properties' => array(), 'methods' => array()); } if ($this->_backupExisting && file_exists($path)) { @@ -1061,4 +1063,4 @@ private function _getIdGeneratorTypeString($type) throw new \InvalidArgumentException('Invalid provided IdGeneratorType: ' . $type); } } -} \ No newline at end of file +}