Skip to content

Commit

Permalink
Merge branch 'DDC-1215'
Browse files Browse the repository at this point in the history
  • Loading branch information
beberlei committed Jul 26, 2011
2 parents 2e3d239 + 598ab36 commit 41a9e96
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions lib/Doctrine/ORM/Tools/EntityGenerator.php
Expand Up @@ -462,6 +462,14 @@ private function _parseTokensInEntityFile($src)

private function _hasProperty($property, ClassMetadataInfo $metadata)
{
if ($this->_extendsClass()) {
// don't generate property if its already on the base class.
$reflClass = new \ReflectionClass($this->_getClassToExtend());
if ($reflClass->hasProperty($property)) {
return true;
}
}

return (
isset($this->_staticReflection[$metadata->name]) &&
in_array($property, $this->_staticReflection[$metadata->name]['properties'])
Expand All @@ -470,6 +478,14 @@ private function _hasProperty($property, ClassMetadataInfo $metadata)

private function _hasMethod($method, ClassMetadataInfo $metadata)
{
if ($this->_extendsClass()) {
// don't generate method if its already on the base class.
$reflClass = new \ReflectionClass($this->_getClassToExtend());
if ($reflClass->hasMethod($method)) {
return true;
}
}

return (
isset($this->_staticReflection[$metadata->name]) &&
in_array($method, $this->_staticReflection[$metadata->name]['methods'])
Expand Down

0 comments on commit 41a9e96

Please sign in to comment.