I have a table called Group that has a HABTM relationship to table
Points.  Group also has a HABTM relationship to Users.  Groups_Points
table manages this relationship.

I can run a $this>Point>Group>findAll command and get an array that
looks like this:

Array ( [0] => Array ( [Group] => Array ( [id] => 1 [user_ID] => 1
[name] => Dallas Photogs [pic1] => [created] => 2009-12-01 21:23:15
[Moderate] => 0 ) [Point] => Array ( [0] => Array ( [id] => 1 [title]
=> Dallas, Texas [description] => dallas [user_ID] => 1 [type] => City
[address] => 101 main st. dallas, tx [city] => dallas [state] => TX
[zip] => 76010  [GroupsPoint] => Array ( [id] => 1 [group_id] => 1
[point_id] => 1 [created] => 2009-12-02 14:36:10 [modified] =>
2009-12-02 14:36:10 ) ) ) [User] => Array ( [0] => Array ( [id] => 1
[username] => John [email] => [email protected] [password] =>
79467e27a472 [first_name] => John [last_name] => Smith  [created] =>
2009-11-24 23:15:16 [modified] => 2009-11-29 01:00:26 [GroupsUser] =>
Array ( [id] => 1 [group_id] => 1 [user_id] => 1 [admin] => 1
[created] => 2009-12-02 14:36:10 [modified] => 2009-12-02
14:36:10 ) ) ) ) )

I can do a foreach command in the view i.e. $groups as $group and
access Group.Name as $group['Group']['name'].

What's the best way to access the User.name data in this array. $group
['User']['username'] results in index not found...I see it's nested
one level deep.

Thanks for the advice in advance!

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" 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