@Geoff, at least he succeeded to have you designing the
architecture  :-):-)

On Aug 2, 3:12 pm, Geoff Ford <[EMAIL PROTECTED]> wrote:
> rtanz,
>
> Your associations are all screwed. Heres how I would tackle it, from
> what I can gather through the numerous posts.
>
> A user has a role and a list of modules to review.  They may have
> different roles for different modules.
> Each module has a list of tasks that must be completed.  The list of
> tasks depends on the role that the user is given.  I have no idea how
> your reviews table fits into the whole thing so I will just ignore it
> for now.
>
> User hasMany Memberships
>
> Membership hasOne User
> Membership hasOne Module
> Membership hasOne Role
> Membership hasOne TaskLists
>
> TaskList hasMany Tasks
> Task hasOne TaskTemplate.
>
> Ok so you create a user .
> Then they are given a module and a role, which together is known as a
> Membership. So now you need to create the TaskList for that
> membership.
>
> This is done by finding all the TaskTemplates for the current role.
>
> Then you give this collection to TaskList along with the membership
> id, looping over each task and saving them in turn.
>
> Then to retrieve your tasks you should be able to do :
> $membershipId = 2;// determined by current logged in user and the
> module they are working on
> $this->Membership->TaskList->findByMemershipId($membeshipId);
>
> This will pull all your tasks and the corresponding tasks templates.
> You may have to increase the $recursive for task list to 2 to get the
> templates.
>
> I hope this makes sense.
>
> And I do like to help despite my half jesting last email.
>
> Geoff Ford
> --http://lemoncake.wordpress.com
>
> On Aug 2, 10:59 pm, Fran Simó <[EMAIL PROTECTED]> wrote:
>
> > Why not to use a property in model?
>
> > Model::afterSave() {
> >     .....
> >     $this->dataToReadFromController="Hello!";
>
> > }
>
> > Controller::add() {
> >     $this->Model->save();
> >     $i=$this->Model->dataToReadFromController;
>
> > }


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to