Doctrine2,如何将repositoryClass引用添加到yaml文件中

I am currently using this to generate my yaml:

doctrine orm:convert-mapping --force --from-database yml ./yaml

However, this doesn't have the repositoryClass reference in them. Is there a way to do this via CLI?

You have to add the repository class manually to the yaml as a repo class has nothing to do with the db schema so convert-mapping is not the tool for the job. Just add the following to your yaml

repositoryClass: Repository\MyRepository

Where Repository\MyRepository is the fully qualified name of your repo class. You could also then use the CLI to generate the file orm:generate-repositories...