find with HABTM problem

2009-09-25 Thread Wladiston Paiva
hi peoples,

i have two models is cakephp:


class Pessoa extends AppModel {
var $name = 'Pessoa';
var $primaryKey = 'codigo';

var $hasAndBelongsToMany = array(
'Areainteresse' =
array(
'className'= 'Areainteresse',
'joinTable'  = 'areainteressepessoa',
'foreignKey' = 'codigopessoa',
'associationForeignKey'  = 'codigoareainteresse'
)
);
}


and

class Areainteresse extends AppModel {
var $name = 'Areainteresse';
var $useTable = 'areainteresse';
var $primaryKey = 'codigo';
}

when i run the $this-Pessoa-find(). he return me:

array(2) {
  [0]=
  array(12) {
[codigo]=
int(6)
  }
  [Areainteresse]=
  array(0) {
  }
}

the Pessoa entity is returned normally, however the entity Areainteresse not
returned.
This only for the find(). the save() work normally.
The data are in the table correctly.

Anyone have any solution?

---
Wladiston Maurício de Paiva
http://wladistonpaiva.com.br
desenvolvedo...@gmail.com
e...@wladistonpaiva.com.br
+55 (31) 8435 - 5380

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: find with HABTM problem

2009-09-25 Thread brian

What does the find() code look like?

It's possible that the problem is with your unconventional column
names. It might work better if you use, eg. 'areainteresse_pessoa' for
the join table and 'pessoa_id' for the key.

Or it might be something else.

On Fri, Sep 25, 2009 at 11:30 AM, Wladiston Paiva
desenvolvedo...@gmail.com wrote:
 hi peoples,

 i have two models is cakephp:


 class Pessoa extends AppModel {
     var $name = 'Pessoa';
     var $primaryKey = 'codigo';

     var $hasAndBelongsToMany = array(
     'Areainteresse' =
     array(
         'className'    = 'Areainteresse',
     'joinTable'  = 'areainteressepessoa',
     'foreignKey' = 'codigopessoa',
     'associationForeignKey'  = 'codigoareainteresse'
     )
     );
 }


 and

 class Areainteresse extends AppModel {
     var $name = 'Areainteresse';
     var $useTable = 'areainteresse';
     var $primaryKey = 'codigo';
 }

 when i run the $this-Pessoa-find(). he return me:

 array(2) {
   [0]=
   array(12) {
 [codigo]=
 int(6)
   }
   [Areainteresse]=
   array(0) {
   }
 }

 the Pessoa entity is returned normally, however the entity Areainteresse not
 returned.
 This only for the find(). the save() work normally.
 The data are in the table correctly.

 Anyone have any solution?

 ---
 Wladiston Maurício de Paiva
 http://wladistonpaiva.com.br
 desenvolvedo...@gmail.com
 e...@wladistonpaiva.com.br
 +55 (31) 8435 - 5380

 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: find with HABTM problem

2009-09-25 Thread Wladiston Paiva
unfortunately not always possible.
because the database already exists. I am only deploying the system in PHP
(currently Delphi). and the base is in Firebird.
I had problems with the Auth component because of the Firebird, I believe
the problem is the integration of the cake with the firebird.

I am installing ZendServer with ZendStudio to test via debugger with MySQL
to work the problem really is the cake.

---
Wladiston Maurício de Paiva
http://wladistonpaiva.com.br
desenvolvedo...@gmail.com
e...@wladistonpaiva.com.br
+55 (31) 8435 - 5380


2009/9/25 brian bally.z...@gmail.com

 What does the find() code look like?

 It's possible that the problem is with your unconventional column
 names. It might work better if you use, eg. 'areainteresse_pessoa' for
 the join table and 'pessoa_id' for the key.

 Or it might be something else.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---