@@ 422-443 (lines=22) @@ | ||
419 | } |
|
420 | } |
|
421 | ||
422 | private function hasProperty($property, ClassMetadataInfo $metadata) |
|
423 | { |
|
424 | if ($this->extendsClass() || class_exists($metadata->name)) { |
|
425 | // don't generate property if its already on the base class. |
|
426 | $reflClass = new \ReflectionClass($this->getClassToExtend() ?: $metadata->name); |
|
427 | ||
428 | if ($reflClass->hasProperty($property)) { |
|
429 | return true; |
|
430 | } |
|
431 | } |
|
432 | ||
433 | foreach ($this->getTraits($metadata) as $trait) { |
|
434 | if ($trait->hasProperty($property)) { |
|
435 | return true; |
|
436 | } |
|
437 | } |
|
438 | ||
439 | return ( |
|
440 | isset($this->staticReflection[$metadata->name]) && |
|
441 | in_array($property, $this->staticReflection[$metadata->name]['properties']) |
|
442 | ); |
|
443 | } |
|
444 | ||
445 | private function hasMethod($method, ClassMetadataInfo $metadata) |
|
446 | { |
|
@@ 445-466 (lines=22) @@ | ||
442 | ); |
|
443 | } |
|
444 | ||
445 | private function hasMethod($method, ClassMetadataInfo $metadata) |
|
446 | { |
|
447 | if ($this->extendsClass() || class_exists($metadata->name)) { |
|
448 | // don't generate method if its already on the base class. |
|
449 | $reflClass = new \ReflectionClass($this->getClassToExtend() ?: $metadata->name); |
|
450 | ||
451 | if ($reflClass->hasMethod($method)) { |
|
452 | return true; |
|
453 | } |
|
454 | } |
|
455 | ||
456 | foreach ($this->getTraits($metadata) as $trait) { |
|
457 | if ($trait->hasMethod($method)) { |
|
458 | return true; |
|
459 | } |
|
460 | } |
|
461 | ||
462 | return ( |
|
463 | isset($this->staticReflection[$metadata->name]) && |
|
464 | in_array($method, $this->staticReflection[$metadata->name]['methods']) |
|
465 | ); |
|
466 | } |
|
467 | ||
468 | private function hasNamespace(ClassMetadataInfo $metadata) |
|
469 | { |