Was missing Post.user_id....

Dave

-----Original Message-----
From: Dave Maharaj :: WidePixels.com [mailto:[email protected]] 
Sent: September-09-09 1:42 PM
To: [email protected]
Subject: Contain not pulling data


I have this contain query
 
$params = array(
        'conditions' => array(
               'Post.featured' => 1,
               'Post.status' => 0,
               'Post.rank <=' => $rank,
               'NOT' => array(
               'Post.id' => $remove)),
        'fields' => array(
           'Post.id',
           'Post.title'),
        'order' => array(
             'Post.created DESC'),
        'contain' => array(
            'User' => array(
                 'fields' => array(
                       'User.id',
                       'User.city',
                       'User.company'),
                 'State' => array(
                      'fields' => array(
                         'State.abrev')),
                 'Country' => array(
                     'fields' => array(
                           'Country.name')))));

Which produces

[0] => Array
        (
            [Post] => Array
                (
                    [id] => 139ea7
                    [title] => Marys Dry Cleaning
                )

            [User] => Array
                (
                    [id] => 4a545892-f828-486d-9e77-54bb4adcd75b
                    [city] => Somecity
                    [company] => Marys Cleaning
                    [state_id] => 4
                    [country_id] => 8
                )

        )

Its not pulling the additional data for State or Country for the User Should
be something like:

[State] => Array
(
[abrev] => CA
)
[Country] => Array
(
[name] => United States
)

added in the array.

Am I just over looking something here?
 
Dave 




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

  • Contain not pulling data Dave Maharaj :: WidePixels.com
    • RE: Contain not pulling data - Solved Dave Maharaj :: WidePixels.com

Reply via email to