本文實例講述了Symfony2聯合查詢實作方法。分享給大家參考,如下:
1.yml文件
Acme\MspadminBundle\Entity\MspArticle: type: entity table: msp_article manyToOne: Channel: targetEntity: MspChannel inversedBy: Articles joinColumn: name: channel_id referencedColumnName: channel_id User: targetEntity: MspUser inversedBy: Userone joinColumn: name: user_id referencedColumnName: user_id
Acme\MspadminBundle\Entity\MspChannel: type: entity table: msp_channel oneToMany: Articles: targetEntity: MspArticle mappedBy: Channel
Acme\MspadminBundle\Entity\MspUser: type: entity table: msp_user oneToMany: Userone: targetEntity: MspArticle mappedBy: User
希望本文所述對大家基於Symfony框架的PHP程式設計有所幫助。
更多Symfony2聯合查詢實作方法相關文章請關注PHP中文網!