Exclude some registers from pagination or complex query

Hi everybody.

I’m new on cakephp and I making a search engine for a system that list some posts. I have a table called Posts that belongsTo Contact and Contact belongsTo Users. So I need to filter Posts by users for example show a list of Posts for Contacts that belong an specific User.

I make this one just creating a new array and check every post if contact belongs to user but this way is not useful at all because pagination still showing all posts for example the total number of post.

I need some ideas to can do this in a better way I think this could be done excluding some post on pagination but I don´t know if this is possible or a complex query but I don´t know how to do it or how to search information about it.

A lot of thanks guys, I hope I explain well my issue.

Have a great day !!