Skip to content
Browse files

Revert "only use already existing reflections"

This reverts commit bb5bdcf.
  • Loading branch information...
1 parent bb5bdcf commit 8e3e2e770a2271caf15899cb3f9a840d94443fa7 @Padam87 committed Mar 26, 2013
Showing with 8 additions and 12 deletions.
  1. +8 −12 lib/Doctrine/ORM/Tools/EntityGenerator.php
View
20 lib/Doctrine/ORM/Tools/EntityGenerator.php
@@ -710,13 +710,11 @@ protected function hasProperty($property, ClassMetadataInfo $metadata)
}
// check traits for existing property
- if (isset($this->staticReflection[$metadata->name])) {
- $reflClass = $this->staticReflection[$metadata->name];
+ $reflClass = new \ReflectionClass($metadata->name);
- foreach ($reflClass->getTraits() as $trait) {
- if ($trait->hasProperty($property)) {
- return true;
- }
+ foreach ($reflClass->getTraits() as $trait) {
+ if ($trait->hasProperty($property)) {
+ return true;
}
}
@@ -744,13 +742,11 @@ protected function hasMethod($method, ClassMetadataInfo $metadata)
}
// check traits for existing method
- if (isset($this->staticReflection[$metadata->name])) {
- $reflClass = $this->staticReflection[$metadata->name];
+ $reflClass = new \ReflectionClass($metadata->name);
- foreach ($reflClass->getTraits() as $trait) {
- if ($trait->hasMethod($method)) {
- return true;
- }
+ foreach ($reflClass->getTraits() as $trait) {
+ if ($trait->hasMethod($method)) {
+ return true;
}
}

0 comments on commit 8e3e2e7

Please sign in to comment.
Something went wrong with that request. Please try again.