Jira issue originally created by user santananl:
When using the CLI tool to generate your entities Doctrine forces a global namespace on all TypeHints in functions. For example I used the sandbox
See file User.php with function setAddress:
Remove this function entirely, so that it can be generated. Then run,
Open file User.php and now the function has become:
note the prepended \ for global namespace
This behaviour would be fine if all types would be in the global scope, but they're not. If you use another entity such as Address in the same namespace it should just generate the proper
public function setAddress(Address $address)
Or better yet, generate the Fully Qualified Namespace
Code responsible for this:
Comment created by @beberlei:
sorry but the code you highlight here on trac is 7 months old, the current code is on Git: www.github.com/doctrine/doctrine2
Are you really using Beta 4?
Comment created by santananl:
yes I'm using beta 4 It's a PEAR install.
Sorry for the outdated URL, here's the proper one.
Ah i know what is causing this issue.
The Disconnected Metadata factory cannot know which namespace the class is in. Are you generating the code from XML or YAML?
No XML or YAML in this setup, just class files and an SQL based backend
Issue was closed with resolution "Fixed"