On Fri, Aug 20, 2010 at 5:34 AM, Andy "Fitz" Diack <[email protected]> wrote:
> Hi all,
>
> Apologies in advance if I have missed a solution to this or something
> obvious.
>
> I am setting up a Blog site and I have specified posts, comments and
> users then used the console to generate my models, controllers and
> views.
>
> This has given me the following code in posts model:
>
>
> var $hasMany = array(
>                'Comment' => array(
>                        'className' => 'Comment',
>                        'foreignKey' => 'post_id',
>                        'dependent' => true,
>                        'conditions' => '',
>                        'fields' => '',
>                        'order' => '',
>                        'limit' => '',
>                        'offset' => '',
>                        'exclusive' => '',
>                        'finderQuery' => '',
>                        'counterQuery' => ''
>                )
>        );
>
>
>        var $belongsTo = array(
>                'User' => array(
>                        'className' => 'User',
>                        'foreignKey' => 'user_id',
>                        'conditions' => '',
>                        'fields' => '',
>                        'order' => ''
>                )
>        );
>
> but when I view the array from the index view for posts (with a
> comment existing) I only get Posts and Users, with no mention of
> Comments.
>
> Is there a reason for this?

Difficult to say without seeing how you're fetching the data.

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