I have many to many relationship between Books <--> Account
How can i write DQL with condition on associative table?
for example SQL:
SELECT books.*, account.id FROM books
LEFT JOIN account_books ON books.id = account_books.books_id AND account_books.account_id = 17
LEFT JOIN account ON account.id = account_books.account_id
In your BooksRepository, should be something like that
Do note that DQL use entity parameters and not SQL columns name
And then in your
action
function: