I am pretty new to cake and I'm working with an existing codebase.
I am trying to do a search, namely find all channels with category X
and have an asset which has the tag Y.
The models are:
Channel:
belongsTo: Channelcategory;
hasMany: Asset
hasMany: Tag (I have defined this association using a finderQuery).
Asset:
belongsTo: Channel
hasAndBelongsToMany: Tag
Tag:
hasAndBelongsToMany: Asset
Channelcategory:
hasMany: Channel;
So, to find a channel with a category I do this in my controller:
$this->set('channels',$this->paginate(array('Channel.active' =>
'Yes','Channelcategory.active' => 'Yes','Channelcategory.shortname' =>
$category)));
But I don't know how (or if) I can do this for category AND tag. I'm
struggling with the syntax, and it might not even be possible!
So, hopefully the above is clear and maybe someone can help me out.
thanks
Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
No comments:
Post a Comment