- define Company::__toString() :
return $this->getComName()
- edit your generator.yml's list section :
list:
peer_method: doSelectJoinCompany
display: [id, company, ...]
Instead of displaying the "company_id" field, directly display the
"company" field, which will result on displaying $object->getCompany()-
>__toString()
If you don't set the peer_method option, you will have one more query
per line in your table, if you have 50 lines you will have 52
queries ! with the peer_method specified, you get back to the usual 2
queries.
If you don't know what doSelectJoin* method you should use, just put
doSelectJoinAll
That's all folks
Partager