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<lunarobel@gmail.com> 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 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