Closed ghunti closed 11 years ago
Ah, yes. It's correct, Application\Entity\User
is what you have to use (when in string context, you always use the FQCN). Can you PR against my slides?
You can also override mappings by rewriting metadata, but that's not a good approach. What you can do is having the entity name configurable somewhere.
Closing, see Ocramius/doctrine-orm-zf2-tutorial#10
I've committed a PR. One other thing, why do we configure doctrine.driver.application_entities.paths if then we need to specify FQCN?
Thanks, Gonçalo
@ghunti that's because the annotation driver scans specific directories for entities. Otherwise, it would have to scan the entire app - could you imagine that? ;)
Thanks. It makes sense ;-)
I Marco.
I've been following your presentation http://marco-pivetta.com/doctrine-orm-zf2-tutorial, but when I'm on the controller, and I write
like you have on http://marco-pivetta.com/doctrine-orm-zf2-tutorial/#/27/3, I keep getting an "Class User does not exist" error.
The only way to fix this is to use full entity path like:
I don't know if that is the only valid way, but if it is, another concern is raised. If Im building module Application and latter on I want another module to override its entities, then the doctrine module will keep using Application entities since I've provided full path correct?
Thanks, Gonçalo