I have a user model, which hasMany user_profiles, each of which
belongsTo a user_data_type which belongs to a user_data_type_category.
So the array of data would look like this:

Array
(
    [User] => Array
        (
            [id] => 1
            [username] => xxxx
            [first_name] => John
            [last_name] => Smith
        )

    [UserProfile] => Array
        (
            [0] => Array
                (
                    [id] => 1
                    [profile_data] => 0208 123 4567
                    [user_data_type_id] => 1
                    [user_id] => 1
                    [UserDataType] => Array
                        (
                            [name] => Home
                            [user_data_type_category_id] => 1
                            [UserDataTypeCategory] => Array
                                (
                                    [name] => Phone numbers
                                )
                        )
                )
            [1] => Array
                (
                    [id] => 3
                    [profile_data] => [email protected]
                    [user_data_type_id] => 2
                    [user_id] => 1
                    [UserDataType] => Array
                        (
                            [name] => Personal
                            [user_data_type_category_id] => 2
                            [UserDataTypeCategory] => Array
                                (
                                    [name] => Email addresses
                                )
                        )
                )
            [2] => Array
                (
                    [id] => 4
                    [profile_data] => 07970 123 4567
                    [user_data_type_id] => 3
                    [user_id] => 1
                    [UserDataType] => Array
                        (
                            [name] => Mobile
                            [user_data_type_category_id] => 1
                            [UserDataTypeCategory] => Array
                                (
                                    [name] => Phone numbers
                                )
                        )
                )
        )
)

I want to present this on a user form, with one panel showing the name
and core stuff, and then another with the user details - effectively
their contact details. I want to group the contact details by
user_data_type_category and then order it by user_data_type. So the
output would look a little like this:

Email Addresses
-Personal
[email protected]
Phone numbers
-Mobile
---07970 123 4567
-Home
---0208 123 4567

I am using Containable to limit the data returned, and I know I can
order within the containable model but that doesn't seem to give me
what I want as you can see from the results in the array above. The
phone numbers are separted.

How can I produce this output (effectively grouping the whole result
set by a leaf in the array), or do I have to do some looping thorugh
the results in the view?
--~--~---------~--~----~------------~-------~--~----~
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