I have after some struggle got HABTM working with object creation.  So
the join table and the working object are being INSERTED.   However
When I do a ->findAll() it does return the Member objects but no
Addresses assosiated with them..

Here is the model code

class Member extends AppModel {
var $name='Member';
var $primaryKey='member_id';
var $recursive=2;

var $validate=array(
                'F_NAME'                =>VALID_NOT_EMPTY,
                'M_NAME'                =>VALID_NOT_EMPTY,
                'L_NAME'                =>VALID_NOT_EMPTY,
                'TITLE'                 =>VALID_NOT_EMPTY,
                'USERNAME'              =>VALID_NOT_EMPTY,
                'PASSWORD'              =>VALID_NOT_EMPTY,
                'GENDER'                =>'/[MFmf]/i',
                'DTBIRTH'               =>VALID_NOT_EMPTY,
//              'DTBIRTH'               =>'/(19|20)\d\d[- /.](0[1-9]|1[012])[- 
/.](0[1-9]|[12]
[0-9]|3[01])/i',
                'HAS_COMMONS_ACCESS'=>VALID_NOT_EMPTY
        );
var $hasAndBelongsToMany = array('Address'=>
                                        array(
                                                'className'                     
        =>'Address',
                                                'joinTable'                     
        =>'member_to_address')
                                        );


}//end class

This is what I get when I pr() the array
Array
(
    [Member] => Array
        (
            [MEMBER_ID] => 4
            [F_NAME] => Chad
            [M_NAME] => M
            [L_NAME] => Crabtree
            [TITLE] =>
            [USERNAME] => flaxeater
            [PASSWORD] => mlnr1000
            [ACTIVE_USERNAME] => T
            [NICK_NAME] =>
            [STATUS] => UNVALID
            [TYPE] =>
            [GENDER] => M
            [DTBIRTH] => 1977-04-20
            [GROUP_TYPE] => NONE
            [DATE_CREATED] => 2007-05-19
            [HAS_COMMONS_ACCESS] => T
        )

    [Address] => Array
        (
        )

)

What am I doing wrong that the Address's are not returned too?


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to