I have two models in my CakePHP application: NewsArticle and Image. A news article can have and belong to many images, but an image is not necessary.
How can I find the first news article in my application that has at least one associated image record, so as any news articles with no related image records are discarded?
You’ll have to use an INNER JOIN (see Joins in CakePHP) to limit the find() based on the existence of an associated HABTM item.