Doctrine 2 : orm:generate-repositories not working
I recently integrated zend framework with doctrine 2. I have some issues with generating repository classes. I have no problems generating proxies.
The weird part is when I generate-reposi开发者_如何学JAVAtories the output says
Repository classes generated to "/library"
But I cant seem to find the files. Inside my Entity class I have:
@Entity(repositoryClass="Entity\Repository\UserRepository")
Does anyone have any idea?
I don't know what is the directory structure you use, but according to most of the guides I found online and the way I implemented it, I guess your Entity
directory is inside somesort of a MyApp
directory which is inside the library
directory.
If this is the case indeed, your @Entity
line should be:
@Entity(repositoryClass="MyApp\Entity\Repository\UserRepository")
as opposed to what you wrote
@Entity(repositoryClass="Entity\Repository\UserRepository")
where MyApp
is your model's root namespace name.
The @Entity
line you wrote, should have generated the repository files in library/Entity/Repository
.
Are you running the doctrine script with the correct path? This is how run it and it created the repos in the correct place
php scripts/doctrine.php orm:generate-repositories library/
I think you are using /library
instead of library/
just a thought.
PS: I run this in one level above the document root.
精彩评论