I am using 1.2 branch from svn, and the bindable behaviour, and am trying to 
limit the fields returned in the dataset.

I am able to specify the fields from the User and Message models, but am don't 
know how to specify the fields to return in the "OutgoingMessage" model, which 
you can see below is part of the "with" association I have setup.

I have tried a few things like this with no luck...

$this->User->restrict('MessagesIn(id)','OutgoingMessage(id)');
$this->User->restrict('MessagesIn(id)','MessagesIn.OutgoingMessage(id)');

Any ideas?

Cheers,
Adam


class User extends Model {

 ....etc...

 var $hasAndBelongsToMany = array(
  'Messages' => array('className' => 'Message', 
             'with' => 'OutgoingMessage', 
             'joinTable' => 'outgoing_messages',
             'foreignKey' => 'recipient_user_id',
             'associationForeignKey' => 'message_id'),
 );

}


// in users controller

$this->User->restrict('Messages(id)');
$users = $this->User->findAll(null, 'id');


// pr($users);

Array
(
    [0] => Array
        (
            [User] => Array
                (
                    [id] => 4
                )

            [Messages] => Array
                (
                    [0] => Array
                        (
                            [id] => 1
                            [OutgoingMessage] => Array
                                (
                                    [id] => 3
                                    [message_id] => 1
                                    [receipt_id] => 
                                    [sender_user_id] => 
                                    [recipient_user_id] => 4
                                    [timestamp_to_deliver] => 
                                    [timestamp_delivered] => 
                                    [delivery_status] => 
                                    [delivery_receipt_raw] => 
                                    [deleted] => 0
                                    [created] => 
                                    [modified] => 
                                )

                        )

                )

        )
)


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