1
0
Fork 0
mirror of synced 2025-04-03 13:23:37 +03:00

entity generator - ignore trait properties and methods

This commit is contained in:
Adam Prager 2013-03-26 20:52:57 +01:00
parent a4db7c8b42
commit 521276f1ed

View file

@ -709,6 +709,15 @@ public function __construct()
} }
} }
// check traits for existing property
$reflClass = new \ReflectionClass($metadata->name);
foreach ($reflClass->getTraits() as $trait) {
if ($trait->hasProperty($property)) {
return true;
}
}
return ( return (
isset($this->staticReflection[$metadata->name]) && isset($this->staticReflection[$metadata->name]) &&
in_array($property, $this->staticReflection[$metadata->name]['properties']) in_array($property, $this->staticReflection[$metadata->name]['properties'])
@ -732,6 +741,15 @@ public function __construct()
} }
} }
// check traits for existing method
$reflClass = new \ReflectionClass($metadata->name);
foreach ($reflClass->getTraits() as $trait) {
if ($trait->hasMethod($method)) {
return true;
}
}
return ( return (
isset($this->staticReflection[$metadata->name]) && isset($this->staticReflection[$metadata->name]) &&
in_array($method, $this->staticReflection[$metadata->name]['methods']) in_array($method, $this->staticReflection[$metadata->name]['methods'])