Friday, March 14, 2014

Re: hasMany Through question

Please clarify what you wants to show when you are adding/editing a StudentLearningOutcome?

1. Adding a new StudentLearningOutcome:
- do you want to see the full list of LuStudentConcentration in order to choose one LuStudentConcentration to relate to the new StudentLearningOutcome?
- do you want to see the full list of LuStudentConcentration in order to choose one or more LuStudentConcentration to relate to the new StudentLearningOutcome?
- other?

2. Editing an existing StudentLearningOutcome:
- do you want to see the full list of related LuStudentConcentration in order to choose one LuStudentConcentration to un-relate from the StudentLearningOutcome?
- do you want to see the full list of related LuStudentConcentration in order to choose one or more LuStudentConcentration to un-relate from the StudentLearningOutcome?
- do you want to see the full list of LuStudentConcentration in order to choose on or more LuStudentConcentration to relate to the StudentLearningOutcome and in order to un-relate existing LuStudentConcentration from the StudentLearningOutcome?
- other?

Enjoy, John Andersen
On Thursday, 13 March 2014 21:35:37 UTC+2, John Sposato wrote:
I have a hasMany through with the joined models having the $hasMany key set to the join, and the join model $belongsTo each of the others.

StudentLearningOutcome hasMany LuStudentConcentrationsStudentLearningOutcome
LuStudentConcentration hasMany LuStudentConcentrationsStudentLearningOutcome
LuStudentConcentrationsStudentLearningOutcomes belongsTo StudentLearningOutcome
LuStudentConcentrationsStudentLearningOutcomes belongsTo LuStudentConcentration

I'm trying to get the LuStudentConcentrations (name field) to show up on the add/edit for a StudentLearningOutcome. However, it's not working.  I'm either getting no options pre-select on the edit, or the wrong options selected.

Is there no cake-magic way to do this?  I've seen articles about writing custom saves that will move data around, but that seems hacky to me.

Thanks!


John

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

No comments: