Re: Do I need to load a Model if I reference it in a contain?
well, If you use it inside a contain there has to be a relation present!
either in the model - hardcoded in $hasMany/$belongsTo or dynamically via bindModel()
but without the relation definition the containable behavior doesnt know what to do with it.
Am Montag, 12. März 2012 13:32:32 UTC+1 schrieb Kro:
I have removed 'var $uses' from a controller and replaced it with
calls to 'loadModel()'. I'm just wondering if I need to load a model
which isn't referenced directly in a function, but is referenced in a
contain.
e.g.
$contain =
array('SurveyResponse'=>array('SurveyQuestion'),' BookingOrder'=>array('Room',' Rate','AddOnPurchase'=>array(' AddOn'))); //
Association between Booking and SurveyResponse in SurveyResponse Model
$this->Booking->contain($contain);
Is it necessary to load the 'SurveyResponse' Model as it is mentioned
in the above contain statement for the Booking Model?
Thanks
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.
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
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home