I have a setup where there are Books
Users
and Logs
. Each Log has a Book and a User and I am trying to retrieve a list of all the books regardless of the user, but then also retrieve the Logs associated with that book (recursive is set to 1), but then only retrieving the logs of the current logged in user.
Hopefully that's clear. I tried using Containable and like so:
$this->Book->contain('Log.user_id = 2');
But unfortunately this leaves out Books for which User 2 has no logs for. Am I going about this correctly and I'm just not using containable properly, or am I doing this all wrong.
Any help is appreciated