Skip to content

Commit

Permalink
Merge branch 'thiagofesta-master'
Browse files Browse the repository at this point in the history
  • Loading branch information
beberlei committed Nov 13, 2011
2 parents 70f0136 + 4571e49 commit bb85372
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/Doctrine/ORM/Proxy/ProxyFactory.php
Expand Up @@ -165,11 +165,13 @@ private function _generateMethods(ClassMetadata $class)
{
$methods = '';

$methodNames = array();
foreach ($class->reflClass->getMethods() as $method) {
/* @var $method ReflectionMethod */
if ($method->isConstructor() || in_array(strtolower($method->getName()), array("__sleep", "__clone"))) {
if ($method->isConstructor() || in_array(strtolower($method->getName()), array("__sleep", "__clone")) || isset($methodNames[$method->getName()])) {
continue;
}
$methodNames[$method->getName()] = true;

if ($method->isPublic() && ! $method->isFinal() && ! $method->isStatic()) {
$methods .= "\n" . ' public function ';
Expand Down Expand Up @@ -234,7 +236,7 @@ private function _generateMethods(ClassMetadata $class)
*/
private function isShortIdentifierGetter($method, $class)
{
$identifier = lcfirst(substr($method->getName(), 3));
$identifier = lcfirst(substr($method->getName(), 3));
return (
$method->getNumberOfParameters() == 0 &&
substr($method->getName(), 0, 3) == "get" &&
Expand Down
Expand Up @@ -39,6 +39,7 @@ public function testCRUD()
$cleanFile = $this->_em->find(get_class($file), $file->getId());

$this->assertInstanceOf('Doctrine\Tests\Models\DirectoryTree\Directory', $cleanFile->getParent());
$this->assertInstanceOf('Doctrine\ORM\Proxy\Proxy', $cleanFile->getParent());
$this->assertEquals($directory->getId(), $cleanFile->getParent()->getId());
$this->assertInstanceOf('Doctrine\Tests\Models\DirectoryTree\Directory', $cleanFile->getParent()->getParent());
$this->assertEquals($root->getId(), $cleanFile->getParent()->getParent()->getId());
Expand Down

0 comments on commit bb85372

Please sign in to comment.