hi,

I have a table with following structure

posts_keywords:
       post_id
       keyword_id
       created


I am trying to find coocurring keywords for this I created a
association like this

var $belongsTo = array(
        'Coocurrence' =>
              array('className' => 'PostsKeyword',
              'foreignKey' => 'post_id',
                      'associationForeignKey' => 'post_id',
              'conditions' => '',
              'fields' => 'PostsKeyword.keyword_id, Coocurrence.keyword_id'
        )
);

However, cakephp ignores my specifications for associationForeignKey
and fields and the final SQL is this

SELECT PostsKeyword.post_id, PostsKeyword.keyword_id, Posts.created,
Coocurrence.post_id, Coocurrence.keyword_id, Coocurrence.created FROM
`posts_keywords` AS `PostsKeyword` LEFT JOIN `posts_keywords` AS
`Coocurrence` ON `PostsKeyword`.`post_id` = `Coocurrence`.`id`

where this should be
left join ............on . 'PostsKeyword'.'post_id' =
'Coocurrence'.'post_id'

I am not sure what's the problem

Regards,
bingo


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
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