Welcome, Guest. Register Now!
   
Mark Forums Read Mark Forums Read Mark Forums Read


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 09-08-2007, 01:16 PM
Junior Member
 
Join Date: Sep 2007
Posts: 1
Default 'Where' clause with relationships, how?

I have a many to many relationship between two tables. I need to select from one table, all of the associative data by specific filter on the 2nd table.

In ruby on rails i do that:
Code:
class User < ActiveRecord::Base
 has_and_belong_to_many :entries, :as=>:items
end

user.items.find(:conditions=>["created_at=?", Date.today()])
in Zend-Framework i only success to make the realtionship so i can do now:
Code:
$user->findEntriesViaItems();
but without the filter i need (by created_at for example)

how can i do this?


(Sorry for my english, english isn't my main language)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 09-10-2007, 08:48 PM
Elemental's Avatar
Senior Member
 
Join Date: Jul 2007
Posts: 122
Default

sounds like your trying to joins, check this thread for more info
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 11:10 PM.