Which controller are you running this from, I assumed you were running
it from the BookingPosition Controller?
Why are you loading all the models with $this->loadModel() they should
be accessible by your model associations? Do all your models confirm
to cake's conventions, have you created all the associations?
If you must link your Request and Meal models in that manner then you
need to create 3 associations to Meal with different Aliases
var $belongsTo = array(
'FirstMeal' => array(
'className' => 'Meal',
'foreignKey' => 'first_meal_id'
),
'LastMeal' => array(
'className' => 'Meal',
'foreignKey' => 'last_meal_id'
),
'MealType' => array(
'className' => 'Meal',
'foreignKey' => 'meal_type_id'
)
);
You would then include fields from these models in the find by calling
them by there aliases
'FirstMeal.field_name', 'LastMeal.field_name', 'MealType.field_name'
HTH
Paul.
Check out the new CakePHP Questions site http://cakeqs.org and help others with
their CakePHP related questions.
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