Re: hasOne issues
DOH!!! It was the recursive valuessometime you just stare at something too long, you know? Thank you so much. Good karma your way. Cheers, Beau --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com 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 -~--~~~~--~~--~--~---
Re: hasOne issues
So the issue with the tables that reference each other and create massive array was solved by removing the hasMany from the 'instit' model and just using the belongsTo in the 'bopp' model. Is it okay to JUST have a 'belongsTo' relationship? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com 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 -~--~~~~--~~--~--~---
Re: hasOne issues
I don't see anything wrong, unless you've set your recursive values high for your find calls. This setup is normal. Bopp belongsTo Instit and Instit hasOne Bopp That allows you get get data from the other model, no matter which you're using. Are you getting an error or some long queries or something? And yes, you can only have the belongsTo if you want, but you lose the ability to see Bopp data when using the Instit model. Having absolutely no clue what a Bopp or Instit might be, that's a decision you'll need to make on your own. :) -- John On May 9, 2007, at 12:21 PM, uolax wrote: > > Now both models are going in loops referencing themselves: > > bopp.php > var $belongsTo = array('Instit' => > array('className' => 'Instit') > ); > > > } > > instit.php > var $hasOne = array('Bopp' => > array('className' => 'Bopp', >'conditions'=> '', >'order' => '', >'limit' => '1', >'foreignKey'=> 'instit_id', >'dependent' => false, >'exclusive' => false, >'finderQuery' => '' > ) > ); > > Anythoughts? > > Thanks, > Beau > > On May 9, 11:05 am, uolax <[EMAIL PROTECTED]> wrote: >> Thanks John. >> >> I guess because I'm mainly working with the Bopp, i wanted other data >> to belong to it. I guess it's just the way I'm thinking about models >> and relations. >> >> Thanks again for making my day easier. >> >> On May 9, 11:01 am, "John David Anderson (_psychic_)" >> >> <[EMAIL PROTECTED]> wrote: >>> On May 9, 2007, at 11:53 AM, uolax wrote: >> This is driving me crazy, I've tried every possible setup in the model and tables and nothing seems to work. Please Please help. >> I have 2 tables, >> bopps - id name desc instit_id >> instits --- id name >> >>> Given this setup, Bopp belongs to Instit. >> >>> The setup you've outlined is backwards. >> >>> -- John > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com 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 -~--~~~~--~~--~--~---
Re: hasOne issues
Now both models are going in loops referencing themselves: bopp.php var $belongsTo = array('Instit' => array('className' => 'Instit') ); } instit.php var $hasOne = array('Bopp' => array('className' => 'Bopp', 'conditions'=> '', 'order' => '', 'limit' => '1', 'foreignKey'=> 'instit_id', 'dependent' => false, 'exclusive' => false, 'finderQuery' => '' ) ); Anythoughts? Thanks, Beau On May 9, 11:05 am, uolax <[EMAIL PROTECTED]> wrote: > Thanks John. > > I guess because I'm mainly working with the Bopp, i wanted other data > to belong to it. I guess it's just the way I'm thinking about models > and relations. > > Thanks again for making my day easier. > > On May 9, 11:01 am, "John David Anderson (_psychic_)" > > <[EMAIL PROTECTED]> wrote: > > On May 9, 2007, at 11:53 AM, uolax wrote: > > > > This is driving me crazy, I've tried every possible setup in the model > > > and tables and nothing seems to work. Please Please help. > > > > I have 2 tables, > > > > bopps > > > - > > > id > > > name > > > desc > > > instit_id > > > > instits > > > --- > > > id > > > name > > > Given this setup, Bopp belongs to Instit. > > > The setup you've outlined is backwards. > > > -- John --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com 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 -~--~~~~--~~--~--~---
Re: hasOne issues
Thanks John. I guess because I'm mainly working with the Bopp, i wanted other data to belong to it. I guess it's just the way I'm thinking about models and relations. Thanks again for making my day easier. On May 9, 11:01 am, "John David Anderson (_psychic_)" <[EMAIL PROTECTED]> wrote: > On May 9, 2007, at 11:53 AM, uolax wrote: > > > > > > > This is driving me crazy, I've tried every possible setup in the model > > and tables and nothing seems to work. Please Please help. > > > I have 2 tables, > > > bopps > > - > > id > > name > > desc > > instit_id > > > instits > > --- > > id > > name > > Given this setup, Bopp belongs to Instit. > > The setup you've outlined is backwards. > > -- John --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com 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 -~--~~~~--~~--~--~---
Re: hasOne issues
On May 9, 2007, at 11:53 AM, uolax wrote: > > This is driving me crazy, I've tried every possible setup in the model > and tables and nothing seems to work. Please Please help. > > I have 2 tables, > > bopps > - > id > name > desc > instit_id > > instits > --- > id > name Given this setup, Bopp belongs to Instit. The setup you've outlined is backwards. -- John --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com 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 -~--~~~~--~~--~--~---
hasOne issues
This is driving me crazy, I've tried every possible setup in the model and tables and nothing seems to work. Please Please help. I have 2 tables, bopps - id name desc instit_id instits --- id name I have 2 models instit.php - var $name = 'Instit'; var $belongsTo = array('Bopp' => array('className' => 'Bopp', 'conditions'=> '', 'order' => '', 'foreignKey'=> 'instit_id' ) ); bopp.php - var $name = 'Bopp'; var $hasOne = array('Instit' => array('className'=> 'Instit', 'conditions'=> '', 'order' => '', 'limit' => '', 'foreignKey'=> 'instit_id', 'dependent' => false, 'exclusive' => false, 'finderQuery' => '')); } where all I want to do is have a number (1 -5) in bopps.instit_id and have those numbers relate to instits.name. Each 'bopp' will only have one associated instits.name, but those names should be avalable for the other 'bopp'. I though a hasOne would be appropriate but no matter what I do (hasMany vs hasOne) the instits.id always references boops.id and not boops.instit_id. Please help..I'm going nuts. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com 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 -~--~~~~--~~--~--~---