How about using WITH in the Judge-Model? Is this a good way to do
it?
class Judges extends AppModel
{
var $name = Judge;
var $hasAndBelongsToMany = array(MediaSegments = array(with =
JudgesMediaSegments));
}
On 15 Apr., 02:37, Bryan Paddock bryanpadd...@gmail.com wrote:
Ah! Thank you!
Hey all,
Going a bit crazy here I think I need a break from this. Anyways,
I have the following tables + relationships
Judges
MediaSegments (a category that the judge is selected to judge)
JudgesMediaSegments (contains judge_id and media_segment_id)
How would I find all the judges that belong
Are you using Containable behaviour? You should be!
Try this...(typed without testing - so go easy on me if it's wrong!)...
From the MediaSegment controller:
$this-MediaSegment-find(
'all',
array(
'contain' = array(
'Judge'
Ah! Thank you!
After a while of tinkering with your code I realised I had the $actsAs in
the controller and not the model :(
Works like a charm. I've modified all of my code now to use containable
behaviour. Gone with recursive = -1.
On Wed, Apr 14, 2010 at 3:45 PM, Jeremy Burns