Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DatabaseMap::getTableByPhpName($phpName) with no namespaces #622

Closed
wants to merge 1 commit into from
Closed

DatabaseMap::getTableByPhpName($phpName) with no namespaces #622

wants to merge 1 commit into from

Conversation

ciromattia
Copy link
Contributor

Correctly add map namespace when $phpName has no backslash (e.g. namespaces are not used) to fix #614.

I did not write a unit test, but it should be focused checking getTableByPhpName($phpName) with $phpName being:

  • Foo
  • FooBar
  • myNameSpace\Foo
  • myNameSpace\FooBar
  • myNameSpace\FooBar\Baz

@staabm
Copy link
Member

staabm commented Feb 27, 2013

@zeuben may you verify this fixes your problem?

@ciromattia could you add a unit test supporting your change?

@ciromattia
Copy link
Contributor Author

I'm trying but I'm not really into namespaces using with propel (our code should support PHP<5.3 atm); I think that some check like

$this->assertEquals($tmap2, $this->databaseMap->getTableByPhpName('Bookstore\Foo2'), 'getTableByPhpName() returns tableMap when namespaced phpName was set by way of TableMap::setPhpName()');

could do the work, but it fails for me; maybe someone more involved using propel's ns can write down a working one.

@jaugustin
Copy link
Member

@ciromattia thank I will look at it and write unit test for that.

@ghost ghost assigned jaugustin Mar 1, 2013
jaugustin added a commit to jaugustin/Propel that referenced this pull request Mar 10, 2013
@jaugustin
Copy link
Member

close this one continue on #629

@jaugustin jaugustin closed this Mar 10, 2013
willdurand added a commit that referenced this pull request Apr 8, 2013
DatabaseMap::getTableByPhpName($phpName) with no namespaces #622 + test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PHP 5.4.6 + Propel 1.6.8
3 participants