| @@ 439-459 (lines=21) @@ | ||
| 436 | } |
|
| 437 | } |
|
| 438 | ||
| 439 | private function hasProperty($property, ClassMetadataInfo $metadata) |
|
| 440 | { |
|
| 441 | if ($this->extendsClass()) { |
|
| 442 | // don't generate property if its already on the base class. |
|
| 443 | $reflClass = new \ReflectionClass($this->getClassToExtend()); |
|
| 444 | if ($reflClass->hasProperty($property)) { |
|
| 445 | return true; |
|
| 446 | } |
|
| 447 | } |
|
| 448 | ||
| 449 | foreach ($this->getTraits($metadata) as $trait) { |
|
| 450 | if ($trait->hasProperty($property)) { |
|
| 451 | return true; |
|
| 452 | } |
|
| 453 | } |
|
| 454 | ||
| 455 | return ( |
|
| 456 | isset($this->staticReflection[$metadata->name]) && |
|
| 457 | in_array($property, $this->staticReflection[$metadata->name]['properties']) |
|
| 458 | ); |
|
| 459 | } |
|
| 460 | ||
| 461 | private function hasMethod($method, ClassMetadataInfo $metadata) |
|
| 462 | { |
|
| @@ 461-481 (lines=21) @@ | ||
| 458 | ); |
|
| 459 | } |
|
| 460 | ||
| 461 | private function hasMethod($method, ClassMetadataInfo $metadata) |
|
| 462 | { |
|
| 463 | if ($this->extendsClass()) { |
|
| 464 | // don't generate method if its already on the base class. |
|
| 465 | $reflClass = new \ReflectionClass($this->getClassToExtend()); |
|
| 466 | if ($reflClass->hasMethod($method)) { |
|
| 467 | return true; |
|
| 468 | } |
|
| 469 | } |
|
| 470 | ||
| 471 | foreach ($this->getTraits($metadata) as $trait) { |
|
| 472 | if ($trait->hasMethod($method)) { |
|
| 473 | return true; |
|
| 474 | } |
|
| 475 | } |
|
| 476 | ||
| 477 | return ( |
|
| 478 | isset($this->staticReflection[$metadata->name]) && |
|
| 479 | in_array($method, $this->staticReflection[$metadata->name]['methods']) |
|
| 480 | ); |
|
| 481 | } |
|
| 482 | ||
| 483 | private function hasNamespace(ClassMetadataInfo $metadata) |
|
| 484 | { |
|