I am trying to contain a query, but the question comes basically from this
situation.
Site has Posts which a User can bookmark, I have the contain working fine so
far, pulls the logged in users saved Posts.
Problem is the owner of each Post can set the Post to Published or Not
Published so when the Logged in user views the saved posts list if they had
originally saved a post that was published and since has been set to Not
Published i do not want that bookmark to appear.
The bookmark table only holds the post_id and the user_id not the
Post.status(0 or 1) so what i did was
'contain' => array(
'Bookmark' => array('fields' => array('Bookmark.id'),
'Post' => array(
'conditions' => array('Post.status' => '0'),
'fields' => array('Post.id'))),
Buts it getting all the bookmarks...how can i limit the bookmarks based on
the status of the Post? i guess i could add the post_status to the bookmarks
table but surly there must be a way to get the bookmarks of the posts based
on the status of the bookmarked posts??
thanks
Dave
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---