Cakephp, Retreive Data for HABTM Models using conditional find
Posted
by ion
on Stack Overflow
See other posts from Stack Overflow
or by ion
Published on 2010-03-21T20:08:47Z
Indexed on
2010/03/21
20:11 UTC
Read the original article
Hit count: 200
There are 2 Models: Project & Category that are bind with HABTM relationship. I would like to perform a search from projects controller that can do the following:
FIND all DISTINCT Project.scedule WHERE Category.slug != 'uncategorised'
Apologies for the syntax, I'm no sequel expert.
What I have managed to do is to retrieve all projects that do not belong to Category uncategorised into an array however I'm not sure as to how to search again the array result for DISTINCT Project.schedule values (needed to fill out a form drop down)
I hope I made myself clear.
© Stack Overflow or respective owner