Re: findAll and model on different database in association
I have analizated the code of dbo_source.php . I have found during the generation of SQL query that the code controls if the useDbConfig of the models are the same. If I set useDbConfig of the belongTo's Model like the useDbConfig of the principal model can I have problem in other operations? On 26 Mar, 11:27, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > If I use a model inside the same database instead a model in an other > database all works fine. > For me the problem is in dbo_source.php function > generateAssociationQuery(...) where the query is generated. > > On 26 Mar, 10:52, "[EMAIL PROTECTED]" > > > > <[EMAIL PROTECTED]> wrote: > > I have found this post that I think it's right for my case: > > >http://groups.google.com/group/cake-php/browse_thread/thread/b542cf43... > > > I have used the solution of Grant but I get the same error ("in the > > Sql query of find all miss the LEFT JOIN relative to the external > > model") > > I use CAKEPHP 1.1.13 > > > On 25 Mar, 20:09, "Chris Hartjes" <[EMAIL PROTECTED]> wrote: > > > > On Tue, Mar 25, 2008 at 2:42 PM, [EMAIL PROTECTED] > > > > <[EMAIL PROTECTED]> wrote: > > > > > Do you know that I have the models in different databases. > > > > I don't think that it's a post about this situation. > > > > #1 - yes, I know you have the models in different databases. Please > > > see my earlier statements in this thread > > > > #2 - you asked about doing left joins - there have been some posts > > > lately about that in this mailing list, which is a totally searchable > > > google group > > > > Add #1 + #2 and you might have a solution. > > > > -- > > > Chris Hartjes > > > Internet Loudmouth > > > Motto for 2008: "Moving from herding elephants to handling snakes..." > > > @TheKeyBoard:http://www.littlehart.net/atthekeyboard-Nascondi testo tra > > > virgolette - > > > - Mostra testo tra virgolette -- Nascondi testo tra virgolette - > > - Mostra testo tra virgolette - --~--~-~--~~~---~--~~ 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: findAll and model on different database in association
If I use a model inside the same database instead a model in an other database all works fine. For me the problem is in dbo_source.php function generateAssociationQuery(...) where the query is generated. On 26 Mar, 10:52, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > I have found this post that I think it's right for my case: > > http://groups.google.com/group/cake-php/browse_thread/thread/b542cf43... > > I have used the solution of Grant but I get the same error ("in the > Sql query of find all miss the LEFT JOIN relative to the external > model") > I use CAKEPHP 1.1.13 > > On 25 Mar, 20:09, "Chris Hartjes" <[EMAIL PROTECTED]> wrote: > > > > > On Tue, Mar 25, 2008 at 2:42 PM, [EMAIL PROTECTED] > > > <[EMAIL PROTECTED]> wrote: > > > > Do you know that I have the models in different databases. > > > I don't think that it's a post about this situation. > > > #1 - yes, I know you have the models in different databases. Please > > see my earlier statements in this thread > > > #2 - you asked about doing left joins - there have been some posts > > lately about that in this mailing list, which is a totally searchable > > google group > > > Add #1 + #2 and you might have a solution. > > > -- > > Chris Hartjes > > Internet Loudmouth > > Motto for 2008: "Moving from herding elephants to handling snakes..." > > @TheKeyBoard:http://www.littlehart.net/atthekeyboard- Nascondi testo tra > > virgolette - > > - Mostra testo tra virgolette - --~--~-~--~~~---~--~~ 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: findAll and model on different database in association
I have found this post that I think it's right for my case: http://groups.google.com/group/cake-php/browse_thread/thread/b542cf436cc8622f/da154103ba2a3af3?lnk=gst&q=Multiple+DB+HasMany I have used the solution of Grant but I get the same error ("in the Sql query of find all miss the LEFT JOIN relative to the external model") I use CAKEPHP 1.1.13 On 25 Mar, 20:09, "Chris Hartjes" <[EMAIL PROTECTED]> wrote: > On Tue, Mar 25, 2008 at 2:42 PM, [EMAIL PROTECTED] > > <[EMAIL PROTECTED]> wrote: > > > Do you know that I have the models in different databases. > > I don't think that it's a post about this situation. > > #1 - yes, I know you have the models in different databases. Please > see my earlier statements in this thread > > #2 - you asked about doing left joins - there have been some posts > lately about that in this mailing list, which is a totally searchable > google group > > Add #1 + #2 and you might have a solution. > > -- > Chris Hartjes > Internet Loudmouth > Motto for 2008: "Moving from herding elephants to handling snakes..." > @TheKeyBoard:http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ 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: findAll and model on different database in association
On Tue, Mar 25, 2008 at 2:42 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Do you know that I have the models in different databases. > I don't think that it's a post about this situation. #1 - yes, I know you have the models in different databases. Please see my earlier statements in this thread #2 - you asked about doing left joins - there have been some posts lately about that in this mailing list, which is a totally searchable google group Add #1 + #2 and you might have a solution. -- Chris Hartjes Internet Loudmouth Motto for 2008: "Moving from herding elephants to handling snakes..." @TheKeyBoard: http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ 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: findAll and model on different database in association
Do you know that I have the models in different databases. I don't think that it's a post about this situation. On 25 Mar, 19:29, "Chris Hartjes" <[EMAIL PROTECTED]> wrote: > On Tue, Mar 25, 2008 at 2:25 PM, [EMAIL PROTECTED] > > <[EMAIL PROTECTED]> wrote: > > > I think that I must make a modify to the core code of CAKE but I > > don't know this. > > Can you pass to me some post about this modify? > > Again, please search this google group on the topic of 'left joins'. > I promise, it's in there. > > You don't have to modify the core. > > You just have to SEARCH THE GOOGLE GROUP for the answer. > > -- > Chris Hartjes > Internet Loudmouth > Motto for 2008: "Moving from herding elephants to handling snakes..." > @TheKeyBoard:http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ 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: findAll and model on different database in association
On Tue, Mar 25, 2008 at 2:25 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > I think that I must make a modify to the core code of CAKE but I > don't know this. > Can you pass to me some post about this modify? Again, please search this google group on the topic of 'left joins'. I promise, it's in there. You don't have to modify the core. You just have to SEARCH THE GOOGLE GROUP for the answer. -- Chris Hartjes Internet Loudmouth Motto for 2008: "Moving from herding elephants to handling snakes..." @TheKeyBoard: http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ 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: findAll and model on different database in association
I think that I must make a modify to the core code of CAKE but I don't know this. Can you pass to me some post about this modify? On 25 Mar, 19:09, "Chris Hartjes" <[EMAIL PROTECTED]> wrote: > On Tue, Mar 25, 2008 at 2:07 PM, [EMAIL PROTECTED] > > <[EMAIL PROTECTED]> wrote: > > > I have found that in this case the SQL query used forfindAll > > operation doesn't have the LEFT JOIN relatively to the Model B. > > Have anyone an idea to change this? > > Search this google group, as it's a topic that has been covered many > times, including recently. > > -- > Chris Hartjes > Internet Loudmouth > Motto for 2008: "Moving from herding elephants to handling snakes..." > @TheKeyBoard:http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ 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: findAll and model on different database in association
On Tue, Mar 25, 2008 at 2:07 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > I have found that in this case the SQL query used for findAll > operation doesn't have the LEFT JOIN relatively to the Model B. > Have anyone an idea to change this? Search this google group, as it's a topic that has been covered many times, including recently. -- Chris Hartjes Internet Loudmouth Motto for 2008: "Moving from herding elephants to handling snakes..." @TheKeyBoard: http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ 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: findAll and model on different database in association
I have found that in this case the SQL query used for findAll operation doesn't have the LEFT JOIN relatively to the Model B. Have anyone an idea to change this? On 25 Mar, 15:01, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > My problem is how I have to set the $condition parameter in findAll > > Example > > Model A DB 1 > Model B DB 2 > > Model A belongsTo with Model B > > var $belongsTo = array( 'ModelB'=>array('className' => 'ModelB', > 'foreignKey' => 'ModelB_id' > ) > ); > > Now In my controller I have > > $this->ModelA->findAll('condition on an attribute of Model B') > . > > If I define this condition like: array("ModelB.attribute"=>'value'); > > I get an error ("Table ModelB doesn't exist") > > On 25 Mar, 14:43, "Chris Hartjes" <[EMAIL PROTECTED]> wrote: > > > > > On Tue, Mar 25, 2008 at 8:16 AM, [EMAIL PROTECTED] > > > <[EMAIL PROTECTED]> wrote: > > > > HI > > > I have two model in association . The problem is that these model are > > > in different database. > > > How can I use the findAll operation to make search on the foreign > > > fields of the association? > > > If the are both on the same server but in different databases, then it > > will be no problem as long as you've setup your models properly (hint: > > $useDbConfig) > > >http://book.cakephp.org/view/66/models > > > -- > > Chris Hartjes > > Internet Loudmouth > > Motto for 2008: "Moving from herding elephants to handling snakes..." > > @TheKeyBoard:http://www.littlehart.net/atthekeyboard- Nascondi testo tra > > virgolette - > > - Mostra testo tra virgolette - --~--~-~--~~~---~--~~ 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: findAll and model on different database in association
My problem is how I have to set the $condition parameter in findAll Example Model A DB 1 Model B DB 2 Model A belongsTo with Model B var $belongsTo = array( 'ModelB'=>array('className' => 'ModelB', 'foreignKey' => 'ModelB_id' ) ); Now In my controller I have $this->ModelA->findAll('condition on an attribute of Model B') . If I define this condition like: array("ModelB.attribute"=>'value'); I get an error ("Table ModelB doesn't exist") On 25 Mar, 14:43, "Chris Hartjes" <[EMAIL PROTECTED]> wrote: > On Tue, Mar 25, 2008 at 8:16 AM, [EMAIL PROTECTED] > > <[EMAIL PROTECTED]> wrote: > > > HI > > I have two model in association . The problem is that these model are > > in different database. > > How can I use the findAll operation to make search on the foreign > > fields of the association? > > If the are both on the same server but in different databases, then it > will be no problem as long as you've setup your models properly (hint: > $useDbConfig) > > http://book.cakephp.org/view/66/models > > -- > Chris Hartjes > Internet Loudmouth > Motto for 2008: "Moving from herding elephants to handling snakes..." > @TheKeyBoard:http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ 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: findAll and model on different database in association
On Tue, Mar 25, 2008 at 8:16 AM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > HI > I have two model in association . The problem is that these model are > in different database. > How can I use the findAll operation to make search on the foreign > fields of the association? If the are both on the same server but in different databases, then it will be no problem as long as you've setup your models properly (hint: $useDbConfig) http://book.cakephp.org/view/66/models -- Chris Hartjes Internet Loudmouth Motto for 2008: "Moving from herding elephants to handling snakes..." @TheKeyBoard: http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
findAll and model on different database in association
HI I have two model in association . The problem is that these model are in different database. How can I use the findAll operation to make search on the foreign fields of the association? --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---