There are 2 entities:
book /** * @ORM\ManyToMany(targetEntity="Category", mappedBy="books", fetch="LAZY") */ category /** * @ORM\ManyToMany(targetEntity="Book", inversedBy="categories", fetch="LAZY") * @ORM\JoinTable(name="book_category_bindings") */ I need to pull through the QueryBuilder all categories to which the book with id = 1 is attached. How to do this?