thanx for the reply brian.. as u have seen in my offered_subjects, i have a "section" field on it, means that a subject can have many sections. thats why i cant simply place an "offered_flag" field in subjects table..actually we already had a running enrollment web app but is also not written using cake and actually a procedural one (hehe).. so do you have any idea on how to associate offered_subjects_enrollee model to subject model so that i can get Subjet.name in my offered_subjects_enrollee view? if there's no way around this, i think im going to jump to model->query() method (huhu)...
On Sep 2, 7:23 am, brian <[email protected]> wrote: > What's the difference between Subject & OfferedSubject? If it's just > that the latter are a subset of all available subjects but are the > only ones currently offered, you might as well add a column to > subjects table as a flag. Say, "enabled" or "current" or something > similar. > > And offered_subjects_enrollees also seems a bit needlessly complex. > I'd think you could get away with just: > > subjects > enrollees > enrollees_subjects (enrollee_id, subject_id) > > ... using HABTM assoc. between Subject & Enrollee. > > That's not to say that this sort of thing is simple. I worked on a > similar project (non-Cake) once and it was *really* complex. The > schedule/calendar part was a real pain. > > I really wish Cake had been around for that, actually. > > > > On Wed, Sep 2, 2009 at 3:20 AM, learning_cake_php<[email protected]> wrote: > > > Im building a school enrollment system then i came across with this > > problem with associations.first of all, i need to link 3 tables: > > > 1. subjects > > -id > > -name > > -lecture_units > > -lab_units > > > 2. offered_subjects > > -id > > -subject_id > > -section > > -schedule > > > 3. offered_subjects_enrollees > > -id > > -offered_subject_id > > -enrollee_id > > > (of course there is an enrollee table but lets just stick with my main > > problem...) > > > using this 3 tables, how can i get the Subject.name using > > OfferedSubjectsEnrollee model? can you please help me with the > > associations guys.. cause in the view of OfferedSubjectsEnrollee, i > > wanted to display the Subject.name of the OfferedSubject an Enrollee > > enrolled.. thanks in advance.. more power cakePHP --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
