Hello everyone, I am into cakephp for a week so the question I am asking is very basic one for most of you guys.
I have a parent child relationship , for which I use belongsTo and hasMany. When I used the bake.php to generate my view.thtml for parent and child. In the view.thtml of parent entity, it generates code to display related children. I do not wish to display all the fields of children, so I have edited the view.thtml to accomadate that. However cake generates the SQL every time using the models I have defined and when I use DEBUG = 2 in core, I can see the dump , and this sql annoys me becasue it gets all the fields from the dbase , no matter which ones I am using. Is there a way to restrict the fields. Now I know that when you use findAll, you can pass fields array, but that is only for listing the parent entity . The children are read as part of internal calls to Model->read(null,$id). If the solution lies in defining the child model with get / add/ delete sql , I dont know how to do that ... becasue it would restrict the ability of the child to display all fields when I am displaying the models in their view ... I would appreceiate your response. Thanks in advance --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
