Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Page
- {
- /** @OneToMany(entity="SharedContent") */
- private $sharedContents;
- /** @ManyToOne(entity="PageType") */
- private $pageType; // výchozí ArrayCollection přes constructor
- }
- class PageType
- {
- /** @OneToMany(entity="Page") */
- private $pages; // výchozí ArrayCollection přes constructor
- /** @ManyToMany(entity="SharedContentType") */
- private $sharedContentTypes; // výchozí ArrayCollection přes constructor
- }
- class SharedContentType
- {
- /** @ManyToMany(entity="PageType") */
- private $pageTypes; // výchozí ArrayCollection přes constructor
- /** @OneToMany(entity="SharedContent") */
- private $sharedContents;
- }
- class SharedContent
- {
- /** @ManyToOne(entity="SharedContent") */
- private $page;
- /** @ManyToOne(entity="SharedContentType") */
- private $type;
- }
- // typy pro page
- $em->getRepository('PageType')->createQueryBuilder('pt')
- ->innerJoin('pt.sharedContentTypes', 'ct');
- // globální typy
- $em->getRepository('SharedContentType')->createQueryBuilder('ct')
- ->leftJoin('pt.pageTypes', 'pt')
- ->where('pt.id IS NULL');
Advertisement
Add Comment
Please, Sign In to add comment