Thanks for the help.
Yes, Set::combine did the trick for me, but there's a complication
that leads me to another question. I did:

$moods = $this->Moods->find('all');
$this->set('moods',
Set::combine($moods,'{n}.Moods.woman_id','{n}.Moods.mood','{n}.Moods.time_id'));

That way in the view, I get an array that is grouped by the times, and
then lists the women's moods.

Like this:

Array
(
    [1] => Array
        (
            [1] => Happy           <--- time 1, woman 1
            [2] => Annoyed       <--- time 1, woman 2
            [3] => Indifferent                       etc.
         )

    [2] => Array
        (
            [1] => Angry
            [2] => Emotional
            [3] => Silly
        )
)

This works as long as there is only one attribute in the "moods" table
that I want to fetch. The question is... Let's say I have more that
one attribute in the moods table. Instead of just "mood", say it was
"inner_feeling" and "displayed_mood" for example. How, using
Set::combine (or some other way), can I get each of those moods to be
an array?

I'd like the data to look like this:

Array
(
    [1] => Array
        (
            [1] => Array
                (
                    [inner_feelings] => Happy
                    [displayed_mood] => Calm
                )
            [2] => Array
                (
                    [inner_feelings] => Annoyed
                    [displayed_mood] => Tolerant
                )
            [3] => Array
                (
                    [inner_feelings] => Indifferent
                    [displayed_mood] => Supportive
                )
         )

    [2] => Array
        (
                     etc...
        )
)

Any ideas? Thanks so much...

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

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.

Reply via email to