I have the following relations:
UserhasManyUserNotificationNotificationhasManyUserNotificationUserNotificationbelongsToUser,Notificationnotificationstable has the following columns:id,subject,contentusers_notificationstable has the following columns:id,user_id,notification_id,status
In the UsersController, how can I retrieve all notifications from one user? (That means, for each notification all these details: subject, content and status).
And also, how can I limit the number of fields returned? As I am making the request from the UsersController, I don't want to retrieve any field from the User model in the find() array.
Thank you!